Make me endpoint accessible through CORS. (#207)

Because the standard router was triggering before the cors one,
a regex not to match `/me` is needed
This commit is contained in:
Marcos Nils
2017-11-06 13:43:41 -03:00
committed by GitHub
parent 389e603e42
commit c5f0f5fab9

View File

@@ -68,8 +68,8 @@ func Register(extend HandlerExtender) {
http.ServeFile(rw, r, "./www/landing.html")
}).Methods("GET")
r.HandleFunc("/users/me", LoggedInUser).Methods("GET")
r.HandleFunc("/users/{userId}", GetUser).Methods("GET")
corsRouter.HandleFunc("/users/me", LoggedInUser).Methods("GET")
r.HandleFunc("/users/{userId:^(?me)}", GetUser).Methods("GET")
r.HandleFunc("/oauth/providers", ListProviders).Methods("GET")
r.HandleFunc("/oauth/providers/{provider}/login", Login).Methods("GET")
r.HandleFunc("/oauth/providers/{provider}/callback", LoginCallback).Methods("GET")