add security features + java property support
- set `ALLOW_PLANTUML_INCLUDE` only once and decentralized inside the `DiagramResponse` class and call this init method after initializing the server - set `PLANTUML_SECURITY_PROFILE` to `INTERNET` by default (BREAKING CHANGES) - add possibility to set PlantUML system properties over a file with `PLANTUML_PROPERTY_FILE` - adjust documentation - add "Breaking changes" hint to README
This commit is contained in:
@@ -41,7 +41,6 @@ import jakarta.servlet.http.HttpServletResponse;
|
||||
|
||||
import net.sourceforge.plantuml.BlockUml;
|
||||
import net.sourceforge.plantuml.FileFormat;
|
||||
import net.sourceforge.plantuml.OptionFlags;
|
||||
import net.sourceforge.plantuml.SourceStringReader;
|
||||
import net.sourceforge.plantuml.core.Diagram;
|
||||
import net.sourceforge.plantuml.core.UmlSource;
|
||||
@@ -54,13 +53,6 @@ import net.sourceforge.plantuml.core.UmlSource;
|
||||
@SuppressWarnings("SERIAL")
|
||||
public class ProxyServlet extends HttpServlet {
|
||||
|
||||
static {
|
||||
OptionFlags.ALLOW_INCLUDE = false;
|
||||
if ("true".equalsIgnoreCase(System.getenv("ALLOW_PLANTUML_INCLUDE"))) {
|
||||
OptionFlags.ALLOW_INCLUDE = true;
|
||||
}
|
||||
}
|
||||
|
||||
public static boolean forbiddenURL(String full) {
|
||||
if (full == null) {
|
||||
return true;
|
||||
|
||||
Reference in New Issue
Block a user