Skip to content

Encoded path will be decoded by middleware.StripSlashes and mismatch routers #23242

Closed
@wolfogre

Description

@wolfogre

Description

When everything is right:

  • https://gitea.com/gitea/blog -> 200
  • https://gitea.com/gitea%2Fblog -> 404

However:

  • https://gitea.com/gitea%2Fblog/ -> 200

It is caused by a bug in middleware.StripSlashes of chi, see go-chi/chi#799

We don't have to wait for it to be fixed in upstream, it can be fixed in #21333 by dropping middleware.StripSlashes.

Gitea Version

7a5af25

Can you reproduce the bug on the Gitea demo site?

Yes

Log Gist

No response

Screenshots

No response

Git Version

No response

Operating System

No response

How are you running Gitea?

command

Database

None

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions