Fix body type possibly containing a charset

This commit is contained in:
Tyler 2018-08-05 05:04:27 -04:00
parent 288c2de7eb
commit 1a5a7c3fb6
1 changed files with 1 additions and 1 deletions

View File

@ -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
}