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) {
require.NoError(t, err)
mux := http.NewServeMux()
mux.HandleFunc("/", irmaServer.HttpHandlerFunc())
mux.HandleFunc("/", irmaServer.HandlerFunc())
httpServer = &http.Server{Addr: ":48680", Handler: mux}
go func() {
_ = httpServer.ListenAndServe()
......
......@@ -408,7 +408,7 @@ func parseDisjunctions(disjunctionsStr []string, conf *irma.Configuration) (irma
func startServer(port int) {
mux := http.NewServeMux()
mux.HandleFunc("/", irmaServer.HttpHandlerFunc())
mux.HandleFunc("/", irmaServer.HandlerFunc())
httpServer = &http.Server{Addr: ":" + strconv.Itoa(port), Handler: mux}
go func() {
err := httpServer.ListenAndServe()
......
......@@ -49,14 +49,14 @@ func (s *Server) StartSession(request interface{}, handler SessionHandler) (*irm
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.
//
// 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.
func (s *Server) HttpHandlerFunc() http.HandlerFunc {
func (s *Server) HandlerFunc() http.HandlerFunc {
return func(w http.ResponseWriter, r *http.Request) {
var message []byte
var err error
......
......@@ -123,7 +123,7 @@ func (s *Server) ClientHandler() http.Handler {
router := chi.NewRouter()
router.Use(cors.New(corsOptions).Handler)
router.Mount("/irma/", s.irmaserv.HttpHandlerFunc())
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.HttpHandlerFunc())
router.Mount("/irma/", s.irmaserv.HandlerFunc())
}
// 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