Skip to content

Commit

Permalink
The ProxyServlet should handle maps too.
Browse files Browse the repository at this point in the history
  • Loading branch information
aadrian authored and arnaudroques committed Jun 29, 2022
1 parent dcc06f9 commit 2d011e2
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion src/main/java/net/sourceforge/plantuml/servlet/ProxyServlet.java
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,12 @@ public void doGet(HttpServletRequest request, HttpServletResponse response) thro
// generate the response
DiagramResponse dr = new DiagramResponse(response, getOutputFormat(fmt), request);
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) {
// Browser has closed the connection, so the HTTP OutputStream is closed
// Silently catch the exception to avoid annoying log
Expand Down Expand Up @@ -156,6 +161,10 @@ private FileFormat getOutputFormat(String format) {
if (format.equals("txt")) {
return FileFormat.UTXT;
}
if (format.equals("map")) {
return FileFormat.UTXT;
}

return FileFormat.PNG;
}

Expand Down

0 comments on commit 2d011e2

Please sign in to comment.