Skip to content

[Regression] Path parameters with queryescaped value were broken. #948

Closed

Description

@aenario

Description

I believe this is caused by bd96cc3#diff-252e46e448f4e037d84d69193c8fdf79L545

I have the following routes

group := router.Group("/:doctype", ValidDoctype)
group.GET("/:docid", getDoc)

Given the underlying storage system, the docid parameter can contains a "/".
The client escape this slash in its requests

GET localhost:8080/data/io.cozy.events/with%2Fslash

Before the above-mentionned commit it worked, now it does not. In the changed bit of code,

r.URL.RawPath= /data/io.cozy.events/with%2Fslash
r.URL.Path= /data/io.cozy.events/with/slash

I believe accepting urlEscaped path parameter makes sense, the issue from #947 could be fixed in static middleware.

Checklist

  • [ x ] Dependencies installed
  • [ x ] No typos
  • [ x ] Searched existing issues and docs

Expected behaviour

Path parameters should be url.QueryEscape-able

Actual behaviour

There is no way to have a Path parameter with a slash in it, I will need to define routes for N number of slashes.

Version/commit

3673d7f

Activity

  1. self-assigned this
    on Jun 7, 2017
  2. aenario commented on Jun 8, 2017

    @aenario
    Author

    Thanks !

  3. added a commit that references this issue on Apr 23, 2025
    c05db06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions