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
78691bed
Commit
78691bed
authored
Feb 06, 2019
by
Sietse Ringers
Browse files
Rename function
parent
02ea4239
Changes
4
Hide whitespace changes
Inline
Side-by-side
internal/sessiontest/server_test.go
View file @
78691bed
...
...
@@ -62,7 +62,7 @@ func StartIrmaClientServer(t *testing.T) {
require
.
NoError
(
t
,
err
)
mux
:=
http
.
NewServeMux
()
mux
.
HandleFunc
(
"/"
,
irmaServer
.
Http
HandlerFunc
())
mux
.
HandleFunc
(
"/"
,
irmaServer
.
HandlerFunc
())
httpServer
=
&
http
.
Server
{
Addr
:
":48680"
,
Handler
:
mux
}
go
func
()
{
_
=
httpServer
.
ListenAndServe
()
...
...
irma/cmd/session.go
View file @
78691bed
...
...
@@ -408,7 +408,7 @@ func parseDisjunctions(disjunctionsStr []string, conf *irma.Configuration) (irma
func
startServer
(
port
int
)
{
mux
:=
http
.
NewServeMux
()
mux
.
HandleFunc
(
"/"
,
irmaServer
.
Http
HandlerFunc
())
mux
.
HandleFunc
(
"/"
,
irmaServer
.
HandlerFunc
())
httpServer
=
&
http
.
Server
{
Addr
:
":"
+
strconv
.
Itoa
(
port
),
Handler
:
mux
}
go
func
()
{
err
:=
httpServer
.
ListenAndServe
()
...
...
server/irmaserver/main.go
View file @
78691bed
...
...
@@ -49,14 +49,14 @@ func (s *Server) StartSession(request interface{}, handler SessionHandler) (*irm
return
qr
,
token
,
nil
}
//
Http
HandlerFunc returns a http.HandlerFunc that handles the IRMA protocol
// HandlerFunc returns a http.HandlerFunc that handles the IRMA protocol
// with IRMA apps.
//
// Example usage:
// http.HandleFunc("/irma/", irmarequestor.
Http
HandlerFunc())
// http.HandleFunc("/irma/", irmarequestor.HandlerFunc())
//
// The IRMA app can then perform IRMA sessions at https://example.com/irma.
func
(
s
*
Server
)
Http
HandlerFunc
()
http
.
HandlerFunc
{
func
(
s
*
Server
)
HandlerFunc
()
http
.
HandlerFunc
{
return
func
(
w
http
.
ResponseWriter
,
r
*
http
.
Request
)
{
var
message
[]
byte
var
err
error
...
...
server/requestorserver/server.go
View file @
78691bed
...
...
@@ -123,7 +123,7 @@ func (s *Server) ClientHandler() http.Handler {
router
:=
chi
.
NewRouter
()
router
.
Use
(
cors
.
New
(
corsOptions
)
.
Handler
)
router
.
Mount
(
"/irma/"
,
s
.
irmaserv
.
Http
HandlerFunc
())
router
.
Mount
(
"/irma/"
,
s
.
irmaserv
.
HandlerFunc
())
return
router
}
...
...
@@ -135,7 +135,7 @@ func (s *Server) Handler() http.Handler {
if
!
s
.
conf
.
separateClientServer
()
{
// Mount server for irmaclient
router
.
Mount
(
"/irma/"
,
s
.
irmaserv
.
Http
HandlerFunc
())
router
.
Mount
(
"/irma/"
,
s
.
irmaserv
.
HandlerFunc
())
}
// Server routes
...
...
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