File tree Expand file tree Collapse file tree 2 files changed +19
-2
lines changed
vaadin/src/main/java/software/xdev/sse/vaadin Expand file tree Collapse file tree 2 files changed +19
-2
lines changed Original file line number Diff line number Diff line change 1+ # 1.0.1
2+ * Vaadin
3+ * Fix `` SecureVaadinRequestCache `` ignoring non-optional url parameters
4+
15# 1.0.0
26_ Initial production ready release_
37
Original file line number Diff line number Diff line change @@ -154,14 +154,27 @@ protected synchronized void initAllowedPaths()
154154 .stream ()
155155 .map (RouteBaseData ::getTemplate )
156156 .filter (s -> !s .isBlank ())
157- .map (s -> s .replace ("/:___url_parameter?" , "/*" ))
157+ .map (s -> {
158+ final String urlParamIdentifier = "/:___url_parameter" ;
159+ final int urlParamIndex = s .indexOf (urlParamIdentifier );
160+ if (urlParamIndex == -1 )
161+ {
162+ return s ;
163+ }
164+
165+ final String substring = s .substring (0 , urlParamIndex );
166+ return substring + "/*"
167+ // Do a full level wildcard if there is more stuff (excluding the optional ?)
168+ // behind the path-part
169+ + (s .length () - substring .length () - urlParamIdentifier .length () <= 1 ? "" : "*" );
170+ })
158171 .map (s -> "/" + s )
159172 .collect (Collectors .toSet ());
160173
161174 LOG .debug ("Allowed paths: {}" , allowedPaths );
162175
163176 this .pathMaxLength = allowedPaths .stream ()
164- .mapToInt (s -> s .length () + (s .endsWith ("/ *" ) ? this .defaultWildcardPathLengthAssumption : 0 ))
177+ .mapToInt (s -> s .length () + (s .endsWith ("*" ) ? this .defaultWildcardPathLengthAssumption : 0 ))
165178 .max ()
166179 .orElse (this .defaultPathMaxLength );
167180
You can’t perform that action at this time.
0 commit comments