mirror of
https://github.com/1f349/go-webdav.git
synced 2024-12-22 08:14:15 +00:00
carddav/caldav: use 308 for .well-known redirects
This makes it a little less ambiguous (and, in case of Go clients, a lot easier) that clients should follow the redirect by sending the same PROPFIND request, including body, to the new location. See also the documentation of [http.Client.Do()][1] and the comments in [http.redirectBehavior()][2]. Confirmed to not make a difference for Evolution and Thunderbird clients. [1]: https://pkg.go.dev/net/http#Client.Do [2]: https://cs.opensource.google/go/go/+/refs/tags/go1.18.2:src/net/http/client.go;drc=d8762b2f4532cc2e5ec539670b88bbc469a13938;l=502
This commit is contained in:
parent
bc3faca3a0
commit
b0c59cdea1
@ -58,7 +58,7 @@ func (h *Handler) ServeHTTP(w http.ResponseWriter, r *http.Request) {
|
||||
return
|
||||
}
|
||||
|
||||
http.Redirect(w, r, principalPath, http.StatusMovedPermanently)
|
||||
http.Redirect(w, r, principalPath, http.StatusPermanentRedirect)
|
||||
return
|
||||
}
|
||||
|
||||
|
@ -57,7 +57,7 @@ func (h *Handler) ServeHTTP(w http.ResponseWriter, r *http.Request) {
|
||||
return
|
||||
}
|
||||
|
||||
http.Redirect(w, r, principalPath, http.StatusMovedPermanently)
|
||||
http.Redirect(w, r, principalPath, http.StatusPermanentRedirect)
|
||||
return
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user