Skip to content

Not able to route double slash in URI path routing #1409

Closed

Description

@agentgt

An old upstream system that is not really in our control occasional put an extra / in the endpoint URI path (yes I realize how dumb that is and hopefully we will get them to stop doing that).

Older frameworks like Spring seems to ignore the double slash (or maybe we have filter that we wrote and I forgot about it).

For example

https://blah.com//v1/blah ==> /v1/blah

I noticed Jooby normalizes this on the developer end (ie mapping // -> /) and thus it appears it is impossible to route // traffic (either automatically handled or specifically mapped). Thus any url that has multiple adjacent / will get a 404. Apparently though // in the path are valid URLs.

I don't really have strong opinions on fixing this as I assume its possible to fix this with a decorator but maybe I'm wrong?

Activity

  1. agentgt commented on Oct 21, 2019

    @agentgt
    ContributorAuthor

    Actually I don't think its possible to fix this with a decorator either given that the decorators only are applied if there are matching handlers?

  2. added this to the 2.3.2 milestone on Dec 16, 2019
  3. jknack commented on Dec 16, 2019

    @jknack
    Member

    I removed the normalization from developer end (it is just something minor now). There are couple of options to normalize the incoming path RouterOption.*

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions