File tree 1 file changed +6
-5
lines changed
src/main/java/ru/mystamps/web/support/spring/security
1 file changed +6
-5
lines changed Original file line number Diff line number Diff line change @@ -84,7 +84,7 @@ class ContentSecurityPolicyHeaderWriter implements HeaderWriter {
84
84
// - 'https://www.gstatic.com' is required by Google Charts
85
85
private static final String SCRIPT_COLLECTION_INFO = " 'unsafe-eval' https://www.gstatic.com" ;
86
86
87
- // - 'self' is required for AJAX requests from our scripts (country suggestions)
87
+ // - 'self' is required for AJAX requests from our scripts (country suggestions on /series/add )
88
88
private static final String CONNECT_SRC = "connect-src 'self'" ;
89
89
90
90
private static final char SEPARATOR = ';' ;
@@ -96,9 +96,8 @@ class ContentSecurityPolicyHeaderWriter implements HeaderWriter {
96
96
+ REPORT_URI .length ()
97
97
+ STYLE_SRC .length ()
98
98
+ SCRIPT_SRC .length ()
99
- + CONNECT_SRC .length ()
100
99
// number of separators between directives
101
- + 6 ;
100
+ + 5 ;
102
101
103
102
@ Override
104
103
public void writeHeaders (HttpServletRequest request , HttpServletResponse response ) {
@@ -135,8 +134,10 @@ private static String constructDirectives(HttpServletRequest request) {
135
134
sb .append (SCRIPT_COLLECTION_INFO );
136
135
}
137
136
138
- sb .append (SEPARATOR )
139
- .append (CONNECT_SRC );
137
+ if (uri .equals (Url .ADD_SERIES_PAGE )) {
138
+ sb .append (SEPARATOR )
139
+ .append (CONNECT_SRC );
140
+ }
140
141
141
142
return sb .toString ();
142
143
}
You can’t perform that action at this time.
0 commit comments