This commit is contained in:
unbyte 2021-01-18 14:15:44 +08:00 committed by GitHub
parent ca062b76d1
commit 9af3803ed9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

2
gin.go
View File

@ -448,7 +448,7 @@ func (engine *Engine) handleHTTPRequest(c *Context) {
} }
if len(allowed) > 0 { if len(allowed) > 0 {
c.handlers = engine.allNoMethod c.handlers = engine.allNoMethod
c.writermem.Header()["Allow"] = []string{strings.Join(allowed, ", ")} c.writermem.Header().Set("Allow", strings.Join(allowed, ", "))
serveError(c, http.StatusMethodNotAllowed, default405Body) serveError(c, http.StatusMethodNotAllowed, default405Body)
return return
} }