vaadin / portlet

Portlet support for Vaadin Flow
https://vaadin.com
Other
2 stars 3 forks source link

Upload is broken in portlet when using 2.7 #190

Closed caalador closed 2 years ago

caalador commented 3 years ago

Trying to upload a file with portlet and Flow 2.7 results in a 500 exception.

On the client:

POST http://localhost:8080/pluto/portal/Test%20Page/__pdtestsuite.TestPortlet1%21764587357%7C0;0/__pdtestsuite.TestPortlet2%21764587357%7C1;1/__pdtests-generic.upload%21764587357%7C2;2/__rs2/__clcacheLevelPage/__ri0x3uidl/__ws0;normal//pluto/portal/Test%20Page/__pdtestsuite.TestPortlet1%21764587357%7C0;0/__pdtestsuite.TestPortlet2%21764587357%7C1;1/__pdtests-generic.upload%21764587357%7C2;2/__rs2/__clcacheLevelPage/__ri0x3VAADIN0x3dynamic0x3resource0x300x389dfeca1-731a-441a-8fbe-97f59949cfea0x3upload/__ws0;normal 500
_uploadFile @ vaadin-bundle-1a8692eb26c8b391fafb.cache.js:1631
_addFile @ vaadin-bundle-1a8692eb26c8b391fafb.cache.js:1631
_addFiles @ vaadin-bundle-1a8692eb26c8b391fafb.cache.js:1631
_onFileInputChange @ vaadin-bundle-1a8692eb26c8b391fafb.cache.js:1631
(anonymous) @ vaadin-bundle-1a8692eb26c8b391fafb.cache.js:156

In pluto logs:

06-Oct-2021 11:11:30.516 SEVERE [http-nio-8080-exec-4] org.apache.catalina.core.StandardWrapperValve.invoke Servlet.service() for servlet [plutoPortalDriver] in context with path [/pluto] threw exception
 org.springframework.security.web.firewall.RequestRejectedException: The request was rejected because the URL was not normalized.
    at org.springframework.security.web.firewall.StrictHttpFirewall.getFirewalledRequest(StrictHttpFirewall.java:296)
    at org.apache.pluto.driver.security.PortalStrictHttpFirewall.getFirewalledRequest(PortalStrictHttpFirewall.java:42)
    at org.springframework.security.web.FilterChainProxy.doFilterInternal(FilterChainProxy.java:194)
    at org.springframework.security.web.FilterChainProxy.doFilter(FilterChainProxy.java:178)
    at org.springframework.web.filter.DelegatingFilterProxy.invokeDelegate(DelegatingFilterProxy.java:357)
    at org.springframework.web.filter.DelegatingFilterProxy.doFilter(DelegatingFilterProxy.java:270)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
    at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:199)
    at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:96)
    at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:610)
    at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:137)
    at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:81)
    at org.apache.catalina.valves.AbstractAccessLogValve.invoke(AbstractAccessLogValve.java:660)
    at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:87)
    at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:343)
    at org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:798)
    at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:66)
    at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:808)
    at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1498)
    at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
    at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
    at java.lang.Thread.run(Thread.java:748)

https://github.com/vaadin/portlet/blob/master/vaadin-portlet-integration-tests/tests-generic/src/test/java/com/vaadin/flow/portal/upload/UploadIT.java

caalador commented 2 years ago

A quick check seems that it is because the request path contains // (...__ri0x3uidl/__ws0;normal//pluto/portal/Test%20Page/__pdtestsui...)