Closed GoogleCodeExporter closed 9 years ago
This is probably on purpose, Gerrit also includes this prefix on its JSON
output to prevent injection in scripts.
Original comment by choro...@wikimedia.org
on 18 Mar 2013 at 7:24
Indeed, working as intended. Many JSON libraries support adding a special
prefix to make the returned source non-executable in order to prevent XSSI
attacks; see for example
https://code.google.com/p/google-gson/issues/detail?id=42
This prefix is always constant for Gitiles, so you can strip the first 5 bytes
of the output. Or up to the first newline, your choice.
Original comment by dborowitz@google.com
on 28 Mar 2013 at 3:15
Original issue reported on code.google.com by
manuel.v...@gmail.com
on 1 Mar 2013 at 8:11