开发者

What does while(1) in Gmail do [duplicate]

开发者 https://www.devze.com 2023-02-07 01:27 出处:网络
This question already exists: Closed 12 years ago. Possib开发者_C百科le Duplicate: Why have “while(1);” in XmlHttpRequest response?
This question already exists: Closed 12 years ago.

Possib开发者_C百科le Duplicate:

Why have “while(1);” in XmlHttpRequest response?

If you take a peek at the XHR POST requests that Gmail makes to the server when it updates the list of your email, you will see that each response starts with:

while(1);

[[["v","CKbPYpt__Vc.en.","8","d7634f09ff9e61c8"]
,["di",342]
,["ub",[["^i",1296218266987]
,["^f",1296218266987]
(...)

Why does Google start each response with endless loop?

I read that it is a security trick http://my.opera.com/hallvors/blog/show.dml/260127 but I am not sure how it is supposed to be a good security measure.


Taking a guess... So that any malicious attempt to eval the response or point a <script> block at the resource, rather than parsing it properly, will fail.

0

精彩评论

暂无评论...
验证码 换一张
取 消