mirror of
https://github.com/restic/rest-server.git
synced 2025-12-07 09:36:13 -08:00
Vendor dependencies
This commit is contained in:
committed by
Zlatko Čalušić
parent
2f0a16d8b7
commit
6054876201
19
vendor/goji.io/dispatch.go
generated
vendored
Normal file
19
vendor/goji.io/dispatch.go
generated
vendored
Normal file
@@ -0,0 +1,19 @@
|
||||
package goji
|
||||
|
||||
import (
|
||||
"net/http"
|
||||
|
||||
"goji.io/internal"
|
||||
)
|
||||
|
||||
type dispatch struct{}
|
||||
|
||||
func (d dispatch) ServeHTTP(w http.ResponseWriter, r *http.Request) {
|
||||
ctx := r.Context()
|
||||
h := ctx.Value(internal.Handler)
|
||||
if h == nil {
|
||||
http.NotFound(w, r)
|
||||
} else {
|
||||
h.(http.Handler).ServeHTTP(w, r)
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user