← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 13411: Minor

 

------------------------------------------------------------
revno: 13411
committer: Lars Helge Øverland <larshelge@xxxxxxxxx>
branch nick: dhis2
timestamp: Mon 2013-12-23 23:28:05 +0100
message:
  Minor
modified:
  dhis-2/dhis-web/dhis-web-api/src/main/java/org/hisp/dhis/api/controller/SvgConversionController.java


--
lp:dhis2
https://code.launchpad.net/~dhis2-devs-core/dhis2/trunk

Your team DHIS 2 developers is subscribed to branch lp:dhis2.
To unsubscribe from this branch go to https://code.launchpad.net/~dhis2-devs-core/dhis2/trunk/+edit-subscription
=== modified file 'dhis-2/dhis-web/dhis-web-api/src/main/java/org/hisp/dhis/api/controller/SvgConversionController.java'
--- dhis-2/dhis-web/dhis-web-api/src/main/java/org/hisp/dhis/api/controller/SvgConversionController.java	2013-12-23 16:29:56 +0000
+++ dhis-2/dhis-web/dhis-web-api/src/main/java/org/hisp/dhis/api/controller/SvgConversionController.java	2013-12-23 22:28:05 +0000
@@ -57,10 +57,11 @@
     @Autowired
     private ContextUtils contextUtils;
     
-    @RequestMapping( value = "/svg.png", method = RequestMethod.POST )
+    @RequestMapping( value = "/svg.png", method = RequestMethod.POST, consumes = ContextUtils.CONTENT_TYPE_XML )
     public void toPng( @RequestBody String svg, @RequestParam( required = false ) String filename, HttpServletResponse response )
         throws Exception
     {
+        System.out.println("--" + svg + "--");
         String name = filename != null ? ( CodecUtils.filenameEncode( filename ) + ".png" ) : "file.png";
 
         contextUtils.configureResponse( response, ContextUtils.CONTENT_TYPE_PNG, CacheStrategy.NO_CACHE, name, true );        
@@ -68,7 +69,7 @@
         convertToPng( svg, response.getOutputStream() );
     }
 
-    @RequestMapping( value = "/svg.pdf", method = RequestMethod.POST )
+    @RequestMapping( value = "/svg.pdf", method = RequestMethod.POST, consumes = ContextUtils.CONTENT_TYPE_XML )
     public void toPdf( @RequestBody String svg, @RequestParam( required = false ) String filename, HttpServletResponse response )
         throws Exception
     {