Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ensure ocs host in config has no protocol #2692

Merged
merged 1 commit into from
Mar 29, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions changelog/unreleased/ocs-ensure-host-no-protocol.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
Bugfix: Ensure that the host in the ocs config endpoint has no protocol

We've fixed the host info in the ocs config endpoint so that it has no protocol, as ownCloud 10 doesn't have it.

https://github.com/cs3org/reva/pull/2692
https://github.com/owncloud/ocis/pull/3113
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ package ocs

import (
"net/http"
"net/url"

"github.com/cs3org/reva/v2/internal/http/services/owncloud/ocs/config"
"github.com/cs3org/reva/v2/internal/http/services/owncloud/ocs/data"
Expand Down Expand Up @@ -50,6 +51,11 @@ func (h *Handler) Init(c *config.Config) {
if h.c.SSL == "" {
h.c.SSL = "false" // TODO get from context?
}

// ensure that host has no protocol
if url, err := url.Parse(h.c.Host); err == nil {
h.c.Host = url.Host + url.Path
}
}

// Handler renders the config
Expand Down