Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
IRMA
Github mirrors
irmago
Commits
4e0da5b7
Commit
4e0da5b7
authored
Feb 05, 2020
by
Leon
Committed by
David Venhoek
Mar 03, 2020
Browse files
Also accept text/plain content-type
parent
bad853a1
Changes
1
Hide whitespace changes
Inline
Side-by-side
server/requestorserver/server.go
View file @
4e0da5b7
...
...
@@ -312,8 +312,10 @@ func (s *Server) handleCreate(w http.ResponseWriter, r *http.Request) {
return
}
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
)
return
}
s
.
conf
.
Logger
.
Warnf
(
"Session request uses unknown authentication method, HTTP headers: %s, HTTP POST body: %s"
,
server
.
ToJson
(
r
.
Header
),
string
(
body
))
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment