Strange JSON response in Google Plus

倾然丶 夕夏残阳落幕 提交于 2019-12-22 04:06:44

问题


While I was debugging an error in Google Plus (while importing FB contacts from Yahoo) I've discovered strange JSON response:

)]}'

[[["er",,,,,500]
,["e",2,,,57]
],'45932b7d6d6dc08e']

Is it some variation of JSONP? Reminds me of an SQL injection rather... So, what's the purpose of the closing brackets and quote at the beginning?


回答1:


It's basically JSON with nulls removed and the garbage added at the beginning to thwart XSRF. Here's some PHP code that will decode it (from an unofficial Google Plus API I'm working on).

https://github.com/jmstriegel/php.googleplusapi/blob/master/lib/GooglePlus/GoogleUtil.php




回答2:


It might be an XSRF defense similar to the one described at What does a Ajax call response like 'for (;;); { json data }' mean?



来源:https://stackoverflow.com/questions/6618441/strange-json-response-in-google-plus

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!