Skip to content

Commit e0c6750

Browse files
committed
ContentSecurityPolicyHeaderWriter.constructDirectives(): extract local variable.
No functional changes.
1 parent d9b322e commit e0c6750

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

src/main/java/ru/mystamps/web/support/spring/security/ContentSecurityPolicyHeaderWriter.java

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -103,8 +103,9 @@ public void writeHeaders(HttpServletRequest request, HttpServletResponse respons
103103
}
104104

105105
private static String constructDirectives(HttpServletRequest request) {
106-
boolean onCollectionInfoPage =
107-
request.getRequestURI().startsWith(COLLECTION_INFO_PAGE_PATTERN);
106+
String uri = request.getRequestURI();
107+
108+
boolean onCollectionInfoPage = uri.startsWith(COLLECTION_INFO_PAGE_PATTERN);
108109

109110
StringBuilder sb = new StringBuilder(MIN_HEADER_LENGTH);
110111

@@ -117,7 +118,7 @@ private static String constructDirectives(HttpServletRequest request) {
117118
if (onCollectionInfoPage) {
118119
sb.append(STYLE_COLLECTION_INFO);
119120

120-
} else if (request.getRequestURI().startsWith(TOGGLZ_PAGES_PATTERN)) {
121+
} else if (uri.startsWith(TOGGLZ_PAGES_PATTERN)) {
121122
sb.append(STYLE_TOGGLZ);
122123
}
123124

0 commit comments

Comments
 (0)