Skip to content
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

Populate HttpServletRequest.servletPath with pathPattern #2559

Open
Hexcles opened this issue Oct 27, 2022 · 2 comments
Open

Populate HttpServletRequest.servletPath with pathPattern #2559

Hexcles opened this issue Oct 27, 2022 · 2 comments

Comments

@Hexcles
Copy link
Collaborator

Hexcles commented Oct 27, 2022

servletPath is always an empty string in misk. We could populate it with the PathPattern of the bound action, which is semantically more intuitive / closer to what a lot of servlet code expects.

cc @JGulbronson

@frojasg
Copy link
Collaborator

frojasg commented Apr 14, 2024

Could you expand on when you ran into this issues? looking at the docs it seems this method leaks some of the implementation details and I want to make sure we cover the following case:

This method will return an empty string ("") if the servlet used to process this request was matched using the "/*" pattern.

@Hexcles
Copy link
Collaborator Author

Hexcles commented Apr 26, 2024

@frojasg sorry I missed your reply. I was migrating some tracing/metrics code originally written for Jersey to our misk app. The code needs the path pattern as a tag, which was extracted from HttpServletRequest.servletPath. I believe this string is empty in misk because misk only binds to /* from jetty's perspective, which according to your linked spec says it should indeed be an empty string... This is indeed a pickle :(

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants