-
Notifications
You must be signed in to change notification settings - Fork 1
refactor router to reduce duplication and remove an external dependency #130
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
Conversation
but not for http server, and I unfortunately based router on the http server. Oops.
|
jason-jackson
left a comment
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.
Not verified everything, hence just comments.
| err := fmt.Errorf("%s path parameter not provided to DeleteCredential, path: %s", IDParam, r.URL.Path) | ||
| jsonResponse(w, err, http.StatusBadRequest) | ||
| log.Printf("%s\n", err) |
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.
I don't think we want/need the path as part of the bad request response, I'd suggest just adding it to the log. Also given that it's passing the path now, should it also be sanitized as well? Actually, since it is "" here the path will always be /webauthn/credential// (or whatever), probably not even worth logging.
| err := fmt.Errorf("%s path parameter not provided to DeleteCredential, path: %s", IDParam, r.URL.Path) | |
| jsonResponse(w, err, http.StatusBadRequest) | |
| log.Printf("%s\n", err) | |
| err := fmt.Errorf("%s path parameter not provided to DeleteCredential", IDParam) | |
| jsonResponse(w, err, http.StatusBadRequest) | |
| log.Println(err) |
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.
Don't you mean that the error check could be removed since (I assume) ServeMux guarantees a non-zero path param?



No description provided.