~emersion/alps-dev

* Configuration: Don't fail when multiple servers specified for schemes v1 PROPOSED

Zach DeCook: 1
 * Configuration: Don't fail when multiple servers specified for schemes

 1 files changed, 0 insertions(+), 3 deletions(-)
Export patchset (mbox)
How do I use this?

Copy & paste the following snippet into your terminal to import this patchset into git:

curl -s https://lists.sr.ht/~emersion/alps-dev/patches/13075/mbox | git am -3
Learn more about email & git

[PATCH] * Configuration: Don't fail when multiple servers specified for schemes Export this patch

---
This allows you to specify a cal/carddav server while using a domain that has SRV
records for imap and smtp.

e.g. `go run ./cmd/alps ccel.org https://cloud.zachdecook.com/remote.php/dav/files/zach/`

(previously, this would crash)

 server.go | 3 ---
 1 file changed, 3 deletions(-)

diff --git a/server.go b/server.go
index 7d7a431..ae39b8d 100644
--- a/server.go
+++ b/server.go
@@ -101,9 +101,6 @@ func (s *Server) Upstream(schemes ...string) (*url.URL, error) {
	if len(urls) == 0 {
		return nil, &NoUpstreamError{schemes}
	}
	if len(urls) > 1 {
		return nil, fmt.Errorf("multiple upstream servers are configured for schemes %v", schemes)
	}
	return urls[0], nil
}

-- 
2.28.0