Ask HN: What's the point of this kind of API?
I have seen some api requests on the web with a https GET response body starting with the following characters:
)]}'
Then this characters are followed by arrays of elements without keys(as a JSON). What's the point of having this structure of response requests?
5 comments
[ 3.5 ms ] story [ 20.8 ms ] threadCompanies like Google and Facebook use this to prevent others from embedding their pages in others.
In some older web browsers (like Firefox 2.0), this was required to prevent an attack where the Array constructor is overridden to capture arrays within a response. This no longer works on any modern browser, but a lot of web services still attempt to defend against it.
https://haacked.com/archive/2008/11/20/anatomy-of-a-subtle-j...