<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Why does Google prepend while(1); to their JSON responses? in Home Automation</title>
    <link>https://www.googlenestcommunity.com/t5/Home-Automation/Why-does-Google-prepend-while-1-to-their-JSON-responses/m-p/481203#M22155</link>
    <description>&lt;P&gt;Why does Google prepend&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;while(1);&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;to their (private) JSON responses?&lt;/P&gt;&lt;P data-unlink="true"&gt;For example, here's a response while turning a calendar on and off in&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;Google Calendar&amp;nbsp;:&lt;/P&gt;&lt;PRE&gt;&lt;SPAN class=""&gt;while&lt;/SPAN&gt; (&lt;SPAN class=""&gt;1&lt;/SPAN&gt;);
[
  [&lt;SPAN class=""&gt;'u'&lt;/SPAN&gt;, [
    [&lt;SPAN class=""&gt;'smsSentFlag'&lt;/SPAN&gt;, &lt;SPAN class=""&gt;'false'&lt;/SPAN&gt;],
    [&lt;SPAN class=""&gt;'hideInvitations'&lt;/SPAN&gt;, &lt;SPAN class=""&gt;'false'&lt;/SPAN&gt;],
    [&lt;SPAN class=""&gt;'remindOnRespondedEventsOnly'&lt;/SPAN&gt;, &lt;SPAN class=""&gt;'true'&lt;/SPAN&gt;],
    [&lt;SPAN class=""&gt;'hideInvitations_remindOnRespondedEventsOnly'&lt;/SPAN&gt;, &lt;SPAN class=""&gt;'false_true'&lt;/SPAN&gt;],
    [&lt;SPAN class=""&gt;'Calendar ID stripped for privacy'&lt;/SPAN&gt;, &lt;SPAN class=""&gt;'false'&lt;/SPAN&gt;],
    [&lt;SPAN class=""&gt;'smsVerifiedFlag'&lt;/SPAN&gt;, &lt;SPAN class=""&gt;'true'&lt;/SPAN&gt;]
  ]]
]&lt;/PRE&gt;&lt;P&gt;I would assume this is to prevent people from doing an&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;eval()&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;on it, but all you'd really have to do is replace the&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;while&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;and then you'd be set. I would assume the eval prevention is to make sure people write safe JSON parsing code.&lt;/P&gt;&lt;P data-unlink="true"&gt;I've seen this used in a couple of other places, too, but a lot more so with Google (Mail, Calendar, Contacts, etc.) Strangely enough,&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;Google Docs&amp;nbsp;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;starts with&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&amp;amp;&amp;amp;&amp;amp;START&amp;amp;&amp;amp;&amp;amp;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;instead, and Google Contacts seems to start with&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;while(1); &amp;amp;&amp;amp;&amp;amp;START&amp;amp;&amp;amp;&amp;amp;.&lt;/P&gt;&lt;P&gt;What's going on here?&lt;/P&gt;</description>
    <pubDate>Sat, 16 Sep 2023 09:35:48 GMT</pubDate>
    <dc:creator>crackstab</dc:creator>
    <dc:date>2023-09-16T09:35:48Z</dc:date>
    <item>
      <title>Why does Google prepend while(1); to their JSON responses?</title>
      <link>https://www.googlenestcommunity.com/t5/Home-Automation/Why-does-Google-prepend-while-1-to-their-JSON-responses/m-p/481203#M22155</link>
      <description>&lt;P&gt;Why does Google prepend&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;while(1);&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;to their (private) JSON responses?&lt;/P&gt;&lt;P data-unlink="true"&gt;For example, here's a response while turning a calendar on and off in&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;Google Calendar&amp;nbsp;:&lt;/P&gt;&lt;PRE&gt;&lt;SPAN class=""&gt;while&lt;/SPAN&gt; (&lt;SPAN class=""&gt;1&lt;/SPAN&gt;);
[
  [&lt;SPAN class=""&gt;'u'&lt;/SPAN&gt;, [
    [&lt;SPAN class=""&gt;'smsSentFlag'&lt;/SPAN&gt;, &lt;SPAN class=""&gt;'false'&lt;/SPAN&gt;],
    [&lt;SPAN class=""&gt;'hideInvitations'&lt;/SPAN&gt;, &lt;SPAN class=""&gt;'false'&lt;/SPAN&gt;],
    [&lt;SPAN class=""&gt;'remindOnRespondedEventsOnly'&lt;/SPAN&gt;, &lt;SPAN class=""&gt;'true'&lt;/SPAN&gt;],
    [&lt;SPAN class=""&gt;'hideInvitations_remindOnRespondedEventsOnly'&lt;/SPAN&gt;, &lt;SPAN class=""&gt;'false_true'&lt;/SPAN&gt;],
    [&lt;SPAN class=""&gt;'Calendar ID stripped for privacy'&lt;/SPAN&gt;, &lt;SPAN class=""&gt;'false'&lt;/SPAN&gt;],
    [&lt;SPAN class=""&gt;'smsVerifiedFlag'&lt;/SPAN&gt;, &lt;SPAN class=""&gt;'true'&lt;/SPAN&gt;]
  ]]
]&lt;/PRE&gt;&lt;P&gt;I would assume this is to prevent people from doing an&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;eval()&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;on it, but all you'd really have to do is replace the&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;while&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;and then you'd be set. I would assume the eval prevention is to make sure people write safe JSON parsing code.&lt;/P&gt;&lt;P data-unlink="true"&gt;I've seen this used in a couple of other places, too, but a lot more so with Google (Mail, Calendar, Contacts, etc.) Strangely enough,&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;Google Docs&amp;nbsp;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;starts with&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&amp;amp;&amp;amp;&amp;amp;START&amp;amp;&amp;amp;&amp;amp;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;instead, and Google Contacts seems to start with&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;while(1); &amp;amp;&amp;amp;&amp;amp;START&amp;amp;&amp;amp;&amp;amp;.&lt;/P&gt;&lt;P&gt;What's going on here?&lt;/P&gt;</description>
      <pubDate>Sat, 16 Sep 2023 09:35:48 GMT</pubDate>
      <guid>https://www.googlenestcommunity.com/t5/Home-Automation/Why-does-Google-prepend-while-1-to-their-JSON-responses/m-p/481203#M22155</guid>
      <dc:creator>crackstab</dc:creator>
      <dc:date>2023-09-16T09:35:48Z</dc:date>
    </item>
  </channel>
</rss>

