cashapp / misk

Microservice Kontainer

Home Page:https://cashapp.github.io/misk/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Populate HttpServletRequest.servletPath with pathPattern

Hexcles opened this issue · comments

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

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.

@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 :(