diff --git a/changelog/unreleased/fix-proofkeys-proxy.md b/changelog/unreleased/fix-proofkeys-proxy.md new file mode 100644 index 000000000..1d04e9e10 --- /dev/null +++ b/changelog/unreleased/fix-proofkeys-proxy.md @@ -0,0 +1,5 @@ +Bugfix: Respect proxy url when validating proofkeys + +We fixed a bug where the proxied wopi URL was not used when validating proofkeys. This caused the validation to fail when the proxy was used. + +https://github.com/owncloud/ocis/pull/1234 diff --git a/services/collaboration/pkg/middleware/proofkeys.go b/services/collaboration/pkg/middleware/proofkeys.go index c3b96835e..d3efc1e9b 100644 --- a/services/collaboration/pkg/middleware/proofkeys.go +++ b/services/collaboration/pkg/middleware/proofkeys.go @@ -35,6 +35,9 @@ func ProofKeysMiddleware(cfg *config.Config, next http.Handler) http.Handler { // the url we need is the one being requested, but we need the // scheme and host, so we'll get those from the configured WOPISrc wopiSrcURL, _ := url.Parse(cfg.Wopi.WopiSrc) + if cfg.Wopi.ProxyURL != "" { + wopiSrcURL, _ = url.Parse(cfg.Wopi.ProxyURL) + } currentURL, _ := url.Parse(r.URL.String()) currentURL.Scheme = wopiSrcURL.Scheme currentURL.Host = wopiSrcURL.Host