mirror of
https://github.com/opencloud-eu/opencloud.git
synced 2026-01-03 02:39:52 -06:00
fix: proofkeys validation with proxy
This commit is contained in:
5
changelog/unreleased/fix-proofkeys-proxy.md
Normal file
5
changelog/unreleased/fix-proofkeys-proxy.md
Normal 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
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user