Skip to content

Commit

Permalink
Improve the content type error message by showing available content t…
Browse files Browse the repository at this point in the history
…ypes (dgraph-io#3532)
  • Loading branch information
Lucas Wang authored and dna2github committed Jul 19, 2019
1 parent e185fc4 commit 6d1582d
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions dgraph/cmd/alpha/http.go
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,8 @@ func queryHandler(w http.ResponseWriter, r *http.Request) {
params.Query = string(body)

default:
x.SetStatus(w, x.ErrorInvalidRequest, "Unsupported Content-Type")
x.SetStatus(w, x.ErrorInvalidRequest, "Unsupported Content-Type. "+
"Supported content types are application/json, application/graphqlpm")
return
}

Expand Down Expand Up @@ -327,7 +328,8 @@ func mutationHandler(w http.ResponseWriter, r *http.Request) {
}

default:
x.SetStatus(w, x.ErrorInvalidRequest, "Unsupported Content-Type")
x.SetStatus(w, x.ErrorInvalidRequest, "Unsupported Content-Type. "+
"Supported content types are application/json, application/rdf")
return
}

Expand Down

0 comments on commit 6d1582d

Please sign in to comment.