From f4523b51af0787795973b403b978ff74737a47ef Mon Sep 17 00:00:00 2001 From: Conrad Hoffmann Date: Tue, 1 Mar 2022 11:04:31 +0100 Subject: carddav: fix accidental shadowing of variables The statement changed here creates new variables, whereas it means to assign values to the previously declared `ao` to be used outside of the if statement. This lead to PUT requests always being sent to a URL containing a new UUID, causing problems with some CardDAV servers. --- plugins/carddav/routes.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'plugins/carddav/routes.go') diff --git a/plugins/carddav/routes.go b/plugins/carddav/routes.go index fe7c37d..6c8a85f 100644 --- a/plugins/carddav/routes.go +++ b/plugins/carddav/routes.go @@ -141,7 +141,7 @@ func registerRoutes(p *plugin) { var ao *carddav.AddressObject var card vcard.Card if addressObjectPath != "" { - ao, err := c.GetAddressObject(addressObjectPath) + ao, err = c.GetAddressObject(addressObjectPath) if err != nil { return fmt.Errorf("failed to query CardDAV address: %v", err) } -- cgit v1.2.3