Allow self for iframes
This commit is contained in:
@@ -0,0 +1,6 @@
|
|||||||
|
Bugfix: CSP rules for silent token refresh in iframe
|
||||||
|
|
||||||
|
When renewing the access token silently web needs to be opened in an iframe. This was previously blocked by a restrictive iframe CSP rule in the `Secure` middleware and has now been fixed by allow `self` for iframes.
|
||||||
|
|
||||||
|
https://github.com/owncloud/ocis/pull/4031
|
||||||
|
https://github.com/owncloud/web/issues/7030
|
||||||
@@ -8,6 +8,7 @@ import (
|
|||||||
func SilentRefresh(next http.Handler) http.Handler {
|
func SilentRefresh(next http.Handler) http.Handler {
|
||||||
return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
|
return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
|
||||||
w.Header().Set("X-Frame-Options", "SAMEORIGIN")
|
w.Header().Set("X-Frame-Options", "SAMEORIGIN")
|
||||||
|
w.Header().Set("Content-Security-Policy", "frame-ancestors 'self'")
|
||||||
next.ServeHTTP(w, r)
|
next.ServeHTTP(w, r)
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user