Skip to content
GitLab
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
29bfbad5
Commit
29bfbad5
authored
Aug 14, 2018
by
Sietse Ringers
Browse files
Use http.MethodGet and friends
parent
8e204c02
Changes
1
Hide whitespace changes
Inline
Side-by-side
irmaserver/backend/api.go
View file @
29bfbad5
...
@@ -121,12 +121,12 @@ func HandleProtocolMessage(
...
@@ -121,12 +121,12 @@ func HandleProtocolMessage(
// Route to handler
// Route to handler
switch
len
(
verb
)
{
switch
len
(
verb
)
{
case
0
:
case
0
:
if
method
==
"DELETE"
{
if
method
==
http
.
MethodDelete
{
session
.
handleDelete
()
session
.
handleDelete
()
status
=
http
.
StatusOK
status
=
http
.
StatusOK
return
return
}
}
if
method
==
"GET"
{
if
method
==
http
.
MethodGet
{
h
:=
http
.
Header
(
headers
)
h
:=
http
.
Header
(
headers
)
min
:=
&
irma
.
ProtocolVersion
{}
min
:=
&
irma
.
ProtocolVersion
{}
max
:=
&
irma
.
ProtocolVersion
{}
max
:=
&
irma
.
ProtocolVersion
{}
...
@@ -144,7 +144,7 @@ func HandleProtocolMessage(
...
@@ -144,7 +144,7 @@ func HandleProtocolMessage(
status
,
output
=
responseJson
(
nil
,
session
.
fail
(
irmaserver
.
ErrorInvalidRequest
,
""
))
status
,
output
=
responseJson
(
nil
,
session
.
fail
(
irmaserver
.
ErrorInvalidRequest
,
""
))
return
return
default
:
default
:
if
method
!=
"POST"
{
if
method
!=
http
.
MethodPost
{
status
,
output
=
responseJson
(
nil
,
session
.
fail
(
irmaserver
.
ErrorInvalidRequest
,
""
))
status
,
output
=
responseJson
(
nil
,
session
.
fail
(
irmaserver
.
ErrorInvalidRequest
,
""
))
return
return
}
}
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new 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