-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(echo): add dynamic path support for echo endpoint #271
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -100,7 +100,8 @@ func (s *Server) registerHandlers() { | |
s.router.HandleFunc("/", s.indexHandler).HeadersRegexp("User-Agent", "^Mozilla.*").Methods("GET") | ||
s.router.HandleFunc("/", s.infoHandler).Methods("GET") | ||
s.router.HandleFunc("/version", s.versionHandler).Methods("GET") | ||
s.router.HandleFunc("/echo", s.echoHandler).Methods("POST") | ||
s.router.HandleFunc("/echo", s.echoHandler).Methods("POST,PUT") | ||
s.router.HandleFunc("/echo/{echo:.*}", s.echoHandler).Methods("POST,PUT") | ||
s.router.HandleFunc("/env", s.envHandler).Methods("GET", "POST") | ||
s.router.HandleFunc("/headers", s.echoHeadersHandler).Methods("GET", "POST") | ||
s.router.HandleFunc("/delay/{wait:[0-9]+}", s.delayHandler).Methods("GET").Name("delay") | ||
|
@@ -119,7 +120,8 @@ func (s *Server) registerHandlers() { | |
s.router.HandleFunc("/token", s.tokenGenerateHandler).Methods("POST") | ||
s.router.HandleFunc("/token/validate", s.tokenValidateHandler).Methods("GET") | ||
s.router.HandleFunc("/api/info", s.infoHandler).Methods("GET") | ||
s.router.HandleFunc("/api/echo", s.echoHandler).Methods("POST") | ||
s.router.HandleFunc("/api/echo", s.echoHandler).Methods("POST,PUT") | ||
s.router.HandleFunc("/api/echo{echo:.*}", s.echoHandler).Methods("POST,PUT") | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This should be consistent with the path patterns used above (currently There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
This is consistent with the previous route paths; both |
||
s.router.HandleFunc("/ws/echo", s.echoWsHandler) | ||
s.router.HandleFunc("/chunked", s.chunkedHandler) | ||
s.router.HandleFunc("/chunked/{wait:[0-9]+}", s.chunkedHandler) | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Suggestions: