diff options
Diffstat (limited to 'plugins')
-rw-r--r-- | plugins/carddav/plugin.go | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/plugins/carddav/plugin.go b/plugins/carddav/plugin.go index 5f51069..317a0d0 100644 --- a/plugins/carddav/plugin.go +++ b/plugins/carddav/plugin.go @@ -41,14 +41,17 @@ func (rt *authRoundTripper) RoundTrip(req *http.Request) (*http.Response, error) } func newPlugin(srv *koushin.Server) (koushin.Plugin, error) { - u, err := srv.Upstream("https", "http+insecure") + u, err := srv.Upstream("carddavs", "carddav+insecure", "https", "http+insecure") if _, ok := err.(*koushin.NoUpstreamError); ok { srv.Logger().Print("carddav: no upstream server provided") return nil, nil } else if err != nil { return nil, fmt.Errorf("carddav: failed to parse upstream CardDAV server: %v", err) } - if u.Scheme == "http+insecure" { + switch u.Scheme { + case "carddavs": + u.Scheme = "https" + case "carddav+insecure", "http+insecure": u.Scheme = "http" } if u.Scheme == "" { |