| 1 | package goji |
| 2 | |
| 3 | import ( |
| 4 | "net/http" |
| 5 | |
| 6 | "goji.io/internal" |
| 7 | ) |
| 8 | |
| 9 | type dispatch struct{} |
| 10 | |
| 11 | func (d dispatch) ServeHTTP(w http.ResponseWriter, r *http.Request) { |
| 12 | ctx := r.Context() |
| 13 | h := ctx.Value(internal.Handler) |
| 14 | if h == nil { |
| 15 | http.NotFound(w, r) |
| 16 | } else { |
| 17 | h.(http.Handler).ServeHTTP(w, r) |
| 18 | } |
| 19 | } |