mirror of
https://git.sr.ht/~sircmpwn/tokidoki
synced 2025-12-12 14:17:21 +01:00
Use NewHTTPError to return better errors
That function is merged upstream, but the current version still depends on some stuff not yet merged into upstream go-webdav.
This commit is contained in:
parent
c2f35df455
commit
4765adc1a3
4 changed files with 27 additions and 14 deletions
|
|
@ -66,15 +66,18 @@ func (u *tokidokiHandler) ServeHTTP(w http.ResponseWriter, r *http.Request) {
|
|||
}
|
||||
}
|
||||
|
||||
opts := webdav.ServeUserPrincipalOptions{
|
||||
UserPrincipalPath: userPrincipalPath,
|
||||
HomeSets: homeSets,
|
||||
}
|
||||
if r.URL.Path == userPrincipalPath {
|
||||
opts := webdav.ServeUserPrincipalOptions{
|
||||
UserPrincipalPath: userPrincipalPath,
|
||||
HomeSets: homeSets,
|
||||
}
|
||||
|
||||
if webdav.ServeUserPrincipal(w, r, opts) {
|
||||
webdav.ServeUserPrincipal(w, r, &opts)
|
||||
return
|
||||
}
|
||||
|
||||
// TODO serve something on / that signals this being a DAV server?
|
||||
|
||||
http.Error(w, http.StatusText(http.StatusBadRequest), http.StatusBadRequest)
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue