Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Fix raw JSON content type. These ones aren't JSONP. Also remove unnec…

…essary trailing semi colon from jsonp responses, it screws with Firebug's JSONP parsing
  • Loading branch information...
commit d95e25777d60bb1565e9aa52cce038744e8ccefd 1 parent d8d2018
@jwheare jwheare authored
Showing with 4 additions and 4 deletions.
  1. +2 −2 src/playdar_http_api.erl
  2. +2 −2 src/playdar_web.erl
View
4 src/playdar_http_api.erl
@@ -180,10 +180,10 @@ respond(Req, R) ->
Qs = Req:parse_qs(),
case proplists:get_value("jsonp", Qs) of
undefined ->
- Req:ok({"text/javascript; charset=utf-8", [], mochijson2:encode(R)});
+ Req:ok({"appplication/json; charset=utf-8", [], mochijson2:encode(R)});
F ->
Req:ok({"text/javascript; charset=utf-8", [],
- F++"("++mochijson2:encode(R)++");\n"})
+ F++"("++mochijson2:encode(R)++")\n"})
end.
View
4 src/playdar_web.erl
@@ -103,7 +103,7 @@ loop1(Req, DocRoot) ->
_ ->
Resp = mochijson2:encode({struct, [{<<"formtoken">>,list_to_binary(Ftok)}]}),
- Req:ok({"text/javascript; charset=utf-8",[],Resp})
+ Req:ok({"appplication/json; charset=utf-8",[],Resp})
end
end;
@@ -134,7 +134,7 @@ loop1(Req, DocRoot) ->
render(Req, DocRoot ++ "/auth.na.html", Vars);
_ ->
Resp = mochijson2:encode({struct, [{<<"authtoken">>,AuthCode}]}),
- Req:ok({"text/javascript; charset=utf-8",[],Resp})
+ Req:ok({"appplication/json; charset=utf-8",[],Resp})
end;
RecUrl ->
Please sign in to comment.
Something went wrong with that request. Please try again.