mirror of
https://github.com/restic/rest-server.git
synced 2025-12-07 09:36:13 -08:00
20 lines
294 B
Go
20 lines
294 B
Go
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)
|
|
}
|
|
}
|