aboutsummaryrefslogtreecommitdiff
path: root/plugins
diff options
context:
space:
mode:
authorSimon Ser <contact@emersion.fr>2020-02-05 13:56:18 +0100
committerSimon Ser <contact@emersion.fr>2020-02-05 13:56:18 +0100
commit3263a89185e27031dbde7007eb4b71db4cd3c54f (patch)
tree84278eaf9eeecae90289df649d0a56c8bc0d4e2d /plugins
parentad256906e0f9f23d97bec268b980154726621e8a (diff)
downloadalps-3263a89185e27031dbde7007eb4b71db4cd3c54f.tar.gz
alps-3263a89185e27031dbde7007eb4b71db4cd3c54f.zip
plugins/carddav: accept "carddavs" and "carddav+insecure" URL schemes
Diffstat (limited to 'plugins')
-rw-r--r--plugins/carddav/plugin.go7
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 == "" {