fix: proofkeys validation with proxy

This commit is contained in:
Michael Barz
2024-11-04 11:21:59 +01:00
parent 821200b48c
commit f9510e028e
2 changed files with 8 additions and 0 deletions

View File

@@ -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

View File

@@ -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