mirror of
https://github.com/docker/docs.git
synced 2026-04-12 06:19:22 +07:00
fix bug that http server should return when handler is nil
Signed-off-by: Sun Hongliang <allen.sun@daocloud.io>
This commit is contained in:
@@ -28,6 +28,7 @@ func (d *dispatcher) SetHandler(handler http.Handler) {
|
||||
func (d *dispatcher) ServeHTTP(w http.ResponseWriter, r *http.Request) {
|
||||
if d.handler == nil {
|
||||
httpError(w, "No dispatcher defined", http.StatusInternalServerError)
|
||||
return
|
||||
}
|
||||
d.handler.ServeHTTP(w, r)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user