Commit 78691bed authored by Sietse Ringers's avatar Sietse Ringers
Browse files

Rename function

parent 02ea4239
...@@ -62,7 +62,7 @@ func StartIrmaClientServer(t *testing.T) { ...@@ -62,7 +62,7 @@ func StartIrmaClientServer(t *testing.T) {
require.NoError(t, err) require.NoError(t, err)
mux := http.NewServeMux() mux := http.NewServeMux()
mux.HandleFunc("/", irmaServer.HttpHandlerFunc()) mux.HandleFunc("/", irmaServer.HandlerFunc())
httpServer = &http.Server{Addr: ":48680", Handler: mux} httpServer = &http.Server{Addr: ":48680", Handler: mux}
go func() { go func() {
_ = httpServer.ListenAndServe() _ = httpServer.ListenAndServe()
......
...@@ -408,7 +408,7 @@ func parseDisjunctions(disjunctionsStr []string, conf *irma.Configuration) (irma ...@@ -408,7 +408,7 @@ func parseDisjunctions(disjunctionsStr []string, conf *irma.Configuration) (irma
func startServer(port int) { func startServer(port int) {
mux := http.NewServeMux() mux := http.NewServeMux()
mux.HandleFunc("/", irmaServer.HttpHandlerFunc()) mux.HandleFunc("/", irmaServer.HandlerFunc())
httpServer = &http.Server{Addr: ":" + strconv.Itoa(port), Handler: mux} httpServer = &http.Server{Addr: ":" + strconv.Itoa(port), Handler: mux}
go func() { go func() {
err := httpServer.ListenAndServe() err := httpServer.ListenAndServe()
......
...@@ -49,14 +49,14 @@ func (s *Server) StartSession(request interface{}, handler SessionHandler) (*irm ...@@ -49,14 +49,14 @@ func (s *Server) StartSession(request interface{}, handler SessionHandler) (*irm
return qr, token, nil return qr, token, nil
} }
// HttpHandlerFunc returns a http.HandlerFunc that handles the IRMA protocol // HandlerFunc returns a http.HandlerFunc that handles the IRMA protocol
// with IRMA apps. // with IRMA apps.
// //
// Example usage: // Example usage:
// http.HandleFunc("/irma/", irmarequestor.HttpHandlerFunc()) // http.HandleFunc("/irma/", irmarequestor.HandlerFunc())
// //
// The IRMA app can then perform IRMA sessions at https://example.com/irma. // The IRMA app can then perform IRMA sessions at https://example.com/irma.
func (s *Server) HttpHandlerFunc() http.HandlerFunc { func (s *Server) HandlerFunc() http.HandlerFunc {
return func(w http.ResponseWriter, r *http.Request) { return func(w http.ResponseWriter, r *http.Request) {
var message []byte var message []byte
var err error var err error
......
...@@ -123,7 +123,7 @@ func (s *Server) ClientHandler() http.Handler { ...@@ -123,7 +123,7 @@ func (s *Server) ClientHandler() http.Handler {
router := chi.NewRouter() router := chi.NewRouter()
router.Use(cors.New(corsOptions).Handler) router.Use(cors.New(corsOptions).Handler)
router.Mount("/irma/", s.irmaserv.HttpHandlerFunc()) router.Mount("/irma/", s.irmaserv.HandlerFunc())
return router return router
} }
...@@ -135,7 +135,7 @@ func (s *Server) Handler() http.Handler { ...@@ -135,7 +135,7 @@ func (s *Server) Handler() http.Handler {
if !s.conf.separateClientServer() { if !s.conf.separateClientServer() {
// Mount server for irmaclient // Mount server for irmaclient
router.Mount("/irma/", s.irmaserv.HttpHandlerFunc()) router.Mount("/irma/", s.irmaserv.HandlerFunc())
} }
// Server routes // Server routes
......
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