Skip to content

Commit b8c548f

Browse files
committed
SecureVaadinRequestCache no longer ignores urlMapping
1 parent 1422956 commit b8c548f

File tree

2 files changed

+9
-1
lines changed

2 files changed

+9
-1
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
# 2.1.1
2+
* Vaadin
3+
* `SecureVaadinRequestCache` no longer ignores `urlMapping`
4+
15
# 2.1.0
26
* Renamed `OAuth2AuthenticationTokenUtil` -> `OAuth2AuthenticationTokenExtractor`
37
* Updated dependencies

vaadin/src/main/java/software/xdev/sse/vaadin/SecureVaadinRequestCache.java

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@
3838
import com.vaadin.flow.router.RouteBaseData;
3939
import com.vaadin.flow.server.VaadinServlet;
4040
import com.vaadin.flow.server.VaadinServletService;
41+
import com.vaadin.flow.spring.security.RequestUtil;
4142
import com.vaadin.flow.spring.security.VaadinDefaultRequestCache;
4243

4344

@@ -56,6 +57,9 @@ public class SecureVaadinRequestCache extends VaadinDefaultRequestCache
5657
@Autowired
5758
protected ServletContext context;
5859

60+
@Autowired
61+
protected RequestUtil requestUtil;
62+
5963
// Shortcut to save computation cost (no path is longer than this)
6064
protected int defaultPathMaxLength = 255;
6165
protected int defaultWildcardPathLengthAssumption = 48;
@@ -154,8 +158,8 @@ protected synchronized void initAllowedPaths()
154158
.stream()
155159
.map(RouteBaseData::getTemplate)
156160
.filter(s -> !s.isBlank())
161+
.map(this.requestUtil::applyUrlMapping)
157162
.map(this::handleUrlParameterInPath)
158-
.map(s -> "/" + s)
159163
.collect(Collectors.toSet());
160164

161165
LOG.debug("Allowed paths: {}", allowedPaths);

0 commit comments

Comments
 (0)