#1 Edited by calebur (8 posts) -

Hey Giant Bomb,

It looks like you use the Location header to redirect an API request to the correct url, but doing so mangles the GET parameters. I noticed in my testing that I was receiving XML when I requested JSON and investigated.

To explain, here are two curl commands I just ran and the Location headers I receive back:

$ curl -L -i "http://giantbomb.com/api/video_types/?api_key=123&format=json"

Location: http://www.giantbomb.com/api/video_types/?api_key=123&format=json?api_key=123&format=json

That's weird, but still does what I wanted.

$ curl -L -i "http://giantbomb.com/api/video_types?api_key=123&format=json"

Location: http://www.giantbomb.com/api/video_types?api_key=123&format=json?api_key=123&format=json

Location: http://www.giantbomb.com/api/video_types/?api_key=123&format=json&format=json%3Fapi_key%3D123

The response is suddenly in XML as the 2nd redirection puts bad data in the final GET variable.