mirror of
https://github.com/restic/rest-server.git
synced 2025-10-19 07:33:21 +00:00
basic auth
This commit is contained in:
parent
59621ca2d6
commit
5c4323a168
5 changed files with 52 additions and 12 deletions
11
handlers.go
11
handlers.go
|
@ -84,7 +84,7 @@ func ListBlob(w http.ResponseWriter, r *http.Request, c *Context) {
|
|||
return
|
||||
}
|
||||
bt := BackendType(uri)
|
||||
if bt.IsNull() {
|
||||
if string(bt) == "" {
|
||||
http.NotFound(w, r)
|
||||
return
|
||||
}
|
||||
|
@ -114,7 +114,7 @@ func HeadBlob(w http.ResponseWriter, r *http.Request, c *Context) {
|
|||
return
|
||||
}
|
||||
bt := BackendType(uri)
|
||||
if bt.IsNull() {
|
||||
if string(bt) == "" {
|
||||
http.NotFound(w, r)
|
||||
return
|
||||
}
|
||||
|
@ -142,7 +142,7 @@ func GetBlob(w http.ResponseWriter, r *http.Request, c *Context) {
|
|||
return
|
||||
}
|
||||
bt := BackendType(uri)
|
||||
if bt.IsNull() {
|
||||
if string(bt) == "" {
|
||||
http.NotFound(w, r)
|
||||
return
|
||||
}
|
||||
|
@ -172,7 +172,7 @@ func PostBlob(w http.ResponseWriter, r *http.Request, c *Context) {
|
|||
return
|
||||
}
|
||||
bt := BackendType(uri)
|
||||
if bt.IsNull() {
|
||||
if string(bt) == "" {
|
||||
http.NotFound(w, r)
|
||||
return
|
||||
}
|
||||
|
@ -191,6 +191,7 @@ func PostBlob(w http.ResponseWriter, r *http.Request, c *Context) {
|
|||
http.NotFound(w, r)
|
||||
return
|
||||
}
|
||||
w.WriteHeader(201)
|
||||
}
|
||||
|
||||
func DeleteBlob(w http.ResponseWriter, r *http.Request, c *Context) {
|
||||
|
@ -206,7 +207,7 @@ func DeleteBlob(w http.ResponseWriter, r *http.Request, c *Context) {
|
|||
return
|
||||
}
|
||||
bt := BackendType(uri)
|
||||
if bt.IsNull() {
|
||||
if string(bt) == "" {
|
||||
http.NotFound(w, r)
|
||||
return
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue