Incorrect MIME types on json responses #18

Closed
jwheare opened this Issue May 15, 2009 · 4 comments

Projects

None yet

2 participants

@jwheare
Contributor
jwheare commented May 15, 2009

Right now the API returns text/html as the content type in responses.

With a jsonp callback wrapper this should be text/javascript, if it's just raw JSON, then use application/json

@jwheare
Contributor
jwheare commented May 15, 2009

I'm guessing this is because playdar_request_handler::serve_dynamic does this:
rep.add_header( "Content-Type", "text/html" );

Even though the API plugin does this

resp.add_header( "Content-Type", req.getvar_exists("jsonp") ?
                              "text/javascript; charset=utf-8" :
                              "text/plain; charset=utf-8" );
@RJ
Owner
RJ commented May 15, 2009

ah, i think add_header has a third param, if you pass "false" it won't nuke existing headers

@jwheare
Contributor
jwheare commented May 15, 2009

Nope, needs a closer look.

@RJ
Owner
RJ commented May 20, 2009

wasn't being set in the non-authed case

This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment