← Back to team overview

dhis2-devs team mailing list archive

Incorrect Content-Type for Data Approvals API (GET /dataApprovals/status)

 

Hi dhis2-devs,

During testing we discovered that the Content-Type is not being set
correctly for the GET /dataApprovals/status API calls. This has
ramifications if you have enabled Gzip compression in your web server and
it looks for specific content types to enable compression (in our case it
looks for *application/json*).

We have patched it on our own branch of DHIS until the fix is merged into
DHIS2. Please find the patch on Launchpad at:

http://bazaar.launchpad.net/~tw-msf/dhis2/dhis2/revision/19288

The diff has also been attached below.

Cheers,

-doh
=== modified file 'dhis-2/dhis-web/dhis-web-api/src/main/java/org/hisp/dhis/webapi/controller/DataApprovalController.java'
--- dhis-2/dhis-web/dhis-web-api/src/main/java/org/hisp/dhis/webapi/controller/DataApprovalController.java	2015-04-30 15:14:27 +0000
+++ dhis-2/dhis-web/dhis-web-api/src/main/java/org/hisp/dhis/webapi/controller/DataApprovalController.java	2016-01-20 05:10:25 +0000
@@ -231,6 +231,7 @@
             }
         }
 
+        response.setContentType( ContextUtils.CONTENT_TYPE_JSON );
         JacksonUtils.toJsonWithView( response.getOutputStream(), dataApprovalStateResponses, BasicView.class );
     }
 


Follow ups