Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit33e7854

Browse files
committed
Allow all images in CSP for now since we hotlink
1 parentf6cbfeb commit33e7854

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

‎stubbornjava-webapp/src/main/java/com/stubbornjava/webapp/StubbornJavaWebApp.java‎

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,9 +36,11 @@ private static HttpHandler exceptionHandler(HttpHandler next) {
3636
privatestaticHttpHandlercontentSecurityPolicy(HttpHandlerdelegate) {
3737
returnnewContentSecurityPolicyHandler.Builder()
3838
.defaultSrc(ContentSecurityPolicy.SELF)
39-
.scriptSrc("'self'","https://www.google-analytics.com")
40-
.imgSrc("'self'","https://www.google-analytics.com")
41-
.connectSrc("'self'","https://www.google-analytics.com")
39+
.scriptSrc(ContentSecurityPolicy.SELF.getValue(),"https://www.google-analytics.com")
40+
// Drop the wildcard when we host our own images.
41+
.imgSrc(ContentSecurityPolicy.SELF.getValue(),"https://www.google-analytics.com","*")
42+
.connectSrc(ContentSecurityPolicy.SELF.getValue(),"https://www.google-analytics.com")
43+
.fontSrc(ContentSecurityPolicy.SELF.getValue(),"data:")
4244
.styleSrc(ContentSecurityPolicy.SELF.getValue(),ContentSecurityPolicy.UNSAFE_INLINE.getValue())
4345
.build(delegate);
4446
}

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp