Why does Google prepend while(1);
(为什么Google会优先使用while(1);
)
to their (private) JSON responses?(他们的(私有)JSON响应?)
For example, here's a response while turning a calendar on and off in Google Calendar :(例如,这是在Google日历中打开和关闭日历时的响应:)
while(1);[['u',[['smsSentFlag','false'],['hideInvitations','false'],
['remindOnRespondedEventsOnly','true'],
['hideInvitations_remindOnRespondedEventsOnly','false_true'],
['Calendar ID stripped for privacy','false'],['smsVerifiedFlag','true']]]]
I would assume this is to prevent people from doing an eval()
on it, but all you'd really have to do is replace the while
and then you'd be set.(我认为这是为了防止人们对它执行eval()
,但是您真正要做的就是替换while
,然后进行设置。)
I would assume the eval prevention is to make sure people write safe JSON parsing code.(我认为评估的目的是确保人们编写安全的JSON解析代码。)
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, Google Docs starts with &&&START&&&
instead, and Google Contacts seems to start with while(1); &&&START&&&
(我已经看到了这个用在其他几个地方也一样,但很多更使谷歌(邮件,日历,联系人等),奇怪的是, 谷歌文档开头&&&START&&&
,而是和谷歌联系人似乎开始与while(1); &&&START&&&
)
while(1); &&&START&&&
.(while(1); &&&START&&&
。)
What's going on here?(这里发生了什么?)
ask by Jess translate from so
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…