-
-
Notifications
You must be signed in to change notification settings - Fork 984
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
Feature: on Go 1.22, fill (*http.Request).PathValue
with URLParam data
#873
Comments
most definitely will add support for the r.PathValue(..) |
I just opened pull request #901 for this |
@angelofallars that seems to be an urelated PR, maybe #901 instead? |
@ptman Whoops, tagged the wrong PR. Thanks for pointing that out |
BTW, it is sometimes handy that you can get the url param from the context instead of from the request. So thanks for keeping chi.URLParamFromCtx while still supporting r.PathValue! |
Hey y'all!
For Go 1.22, this enhanced
ServeMux
routing proposal was accepted and pushed into the main tree, and*http.Request
has some new methods,SetPathValue
andPathValue
. I thinkr.PathValue(...)
could act as an alias forchi.URLParam(r, ...)
when routing with chi.There would probably need to be some logic with
//go:build go1.22
that runsSetPathValue
when inserting keys/values into chi.Context.URLParams for the corresponding http.Request. I have not dug deeper into chi's source code, but I think this would be a welcome addition for when Go 1.22 is released.The text was updated successfully, but these errors were encountered: