Commit 4e0da5b7 authored by Leon's avatar Leon Committed by David Venhoek
Browse files

Also accept text/plain content-type

parent bad853a1
......@@ -312,8 +312,10 @@ func (s *Server) handleCreate(w http.ResponseWriter, r *http.Request) {
if !applies {
if r.Header.Get("Content-Type") != "application/json" {
server.WriteError(w, server.ErrorInvalidRequest, "Content-Type is not \"application/json\"")
var ctype = r.Header.Get("Content-Type")
if ctype != "application/json" && ctype != "text/plain" {
s.conf.Logger.Warnf("Session request uses unsupported Content-Type: %s", ctype)
server.WriteError(w, server.ErrorInvalidRequest, "Unsupported Content-Type: "+ctype)
s.conf.Logger.Warnf("Session request uses unknown authentication method, HTTP headers: %s, HTTP POST body: %s", server.ToJson(r.Header), string(body))
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment