Skip to content

Commit

Permalink
Allow self for iframes
Browse files Browse the repository at this point in the history
  • Loading branch information
kulmann committed Jun 27, 2022
1 parent 317eb80 commit 00a3e2a
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
6 changes: 6 additions & 0 deletions changelog/unreleased/fix-csp-silent-refresh.md
Original file line number Diff line number Diff line change
@@ -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
1 change: 1 addition & 0 deletions extensions/web/pkg/middleware/silentrefresh.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import (
func SilentRefresh(next http.Handler) http.Handler {
return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
w.Header().Set("X-Frame-Options", "SAMEORIGIN")
w.Header().Set("Content-Security-Policy", "frame-ancestors 'self'")
next.ServeHTTP(w, r)
})
}

0 comments on commit 00a3e2a

Please sign in to comment.