The ProxyServlet should handle maps too.

This commit is contained in:
aadrian 2022-06-29 22:32:51 +02:00 committed by PlantUML
parent dcc06f9afc
commit 2d011e233e
1 changed files with 10 additions and 1 deletions

View File

@ -93,7 +93,12 @@ public class ProxyServlet extends HttpServlet {
// generate the response // generate the response
DiagramResponse dr = new DiagramResponse(response, getOutputFormat(fmt), request); DiagramResponse dr = new DiagramResponse(response, getOutputFormat(fmt), request);
try { try {
dr.sendDiagram(uml, 0); // special handling for the MAP since it's not using "#sendDiagram()" like the other types
if ("map".equals(fmt)) {
dr.sendMap(uml, 0);
} else {
dr.sendDiagram(uml, 0);
}
} catch (IIOException e) { } catch (IIOException e) {
// Browser has closed the connection, so the HTTP OutputStream is closed // Browser has closed the connection, so the HTTP OutputStream is closed
// Silently catch the exception to avoid annoying log // Silently catch the exception to avoid annoying log
@ -156,6 +161,10 @@ public class ProxyServlet extends HttpServlet {
if (format.equals("txt")) { if (format.equals("txt")) {
return FileFormat.UTXT; return FileFormat.UTXT;
} }
if (format.equals("map")) {
return FileFormat.UTXT;
}
return FileFormat.PNG; return FileFormat.PNG;
} }