]> source.dussan.org Git - gitblit.git/commitdiff
Properly set application/json content-type on api calls
authorJames Moger <james.moger@gitblit.com>
Fri, 12 Apr 2013 12:48:19 +0000 (08:48 -0400)
committerJames Moger <james.moger@gitblit.com>
Fri, 12 Apr 2013 12:48:19 +0000 (08:48 -0400)
releases.moxie
src/main/java/com/gitblit/JsonServlet.java

index 1dcf091288e06cf5621d13ba18f227d5a5b8c33d..86b4c8777c648b65d8d4ad8b6c450b8538eea7bb 100644 (file)
@@ -26,6 +26,7 @@ r17: {
 \r
        changes:\r
         - Disable Gson's pretty printing which has a huge performance gain\r
+        - Properly set application/json content-type on api calls\r
         - Updated Polish translation\r
         \r
     additions: \r
index 3ad2b7d2955b00fd3d910b000d2696929d1a2861..3ee4a272ae8f2b832aad5ffc2091f288fa0a6204 100644 (file)
@@ -123,6 +123,7 @@ public abstract class JsonServlet extends HttpServlet {
                        // Send JSON response\r
                        String json = JsonUtils.toJsonString(o);\r
                        response.setCharacterEncoding(Constants.ENCODING);\r
+                       response.setContentType("application/json");\r
                        response.getWriter().append(json);\r
                }\r
        }\r