Fix body type possibly containing a charset
This commit is contained in:
parent
288c2de7eb
commit
1a5a7c3fb6
2
main.go
2
main.go
|
@ -165,7 +165,7 @@ type domainRequest struct {
|
|||
}
|
||||
|
||||
func updateRecord(w http.ResponseWriter, r *http.Request, p httprouter.Params) {
|
||||
if r.Header.Get("Content-Type") != "application/json" {
|
||||
if !strings.HasPrefix(r.Header.Get("Content-Type"), "application/json") {
|
||||
errorResponse(w, http.StatusBadRequest, "Invalid body type.")
|
||||
return
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue