You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When Armeria server handles a request with encoded path e.g. MIN%2FMAX it won't decode it to MIN/MAX and the handling logic function will get the encoded MIN%2FMAX value
Investigation
While looking at the implementation of the pathSegments method from other servers I can see that there is a common implementation such as:
however, ArmeriaServerRequest implements the method as
ctx.path().substring(1).split("/").toList
and thus does not decode the path segments
Suggestion
Right away I have to say that I'm not very familiar with Tapir code, so my ideas are based only on a brief interaction I had while researching this issue.
I can see, that there is a common approach of doing certain things, e.g.: once you have a URI, it's straightforward to extract path segments. Maybe it can be beneficial if we can extract the implementation of methods like pathSegments to the ServerRequest trait, and just have subclasses to implement the extraction of a URI from their respective data?
The text was updated successfully, but these errors were encountered:
Uko
added a commit
to Uko/tapir
that referenced
this issue
Nov 13, 2024
Tapir version: 1.11.8
Scala version: 2.13.15
Describe the bug
When Armeria server handles a request with encoded path e.g.
MIN%2FMAX
it won't decode it toMIN/MAX
and the handling logic function will get the encodedMIN%2FMAX
valueInvestigation
While looking at the implementation of the
pathSegments
method from other servers I can see that there is a common implementation such as:uri.pathSegments.segments.map(_.v).filter(_.nonEmpty).toList
however, ArmeriaServerRequest implements the method as
ctx.path().substring(1).split("/").toList
and thus does not decode the path segments
Suggestion
Right away I have to say that I'm not very familiar with Tapir code, so my ideas are based only on a brief interaction I had while researching this issue.
I can see, that there is a common approach of doing certain things, e.g.: once you have a URI, it's straightforward to extract path segments. Maybe it can be beneficial if we can extract the implementation of methods like
pathSegments
to theServerRequest
trait, and just have subclasses to implement the extraction of a URI from their respective data?The text was updated successfully, but these errors were encountered: