Description
Describe the issue
Using Unicode characters (e.g., emojis or Japanese text) in the path segment causes the route to return NotFound instead of the expected response.
Vapor version
4.113.2
Operating system and version
macOS 15.3.1
Swift version
Swift Package Manager - Swift 6.0.3
Steps to reproduce
- Create a new Vapor project (or open an existing one).
- Define routes that include Unicode characters (for example, emojis or Japanese text) in the path segments. For instance:
app.get("Good👍") { req in return "👍" } app.get("ようこそ世界へ") { req in return "おめでとう" }
- Run the application in the usual manner (e.g.,
swift run
, or using Xcode). - Send a request to these routes (e.g.,
GET /Good👍
orGET /ようこそ世界へ
). - Observe that the response status is
NotFound
instead of returning the expected body (e.g.,"👍"
or"おめでとう"
).
Outcome
Observed (Incorrect) Behavior
When sending a request to any route that includes Unicode characters (such as /Good👍
or /ようこそ世界へ
), Vapor returns a NotFound
status code. This indicates that the router fails to match these paths to the defined routes.
Expected Behavior
Vapor should correctly match these routes containing Unicode path segments and return the intended response. For example, a request to GET /Good👍
should return a 200 OK
with "👍"
in the response body, and a request to GET /ようこそ世界へ
should return 200 OK
with "おめでとう"
.
Additional notes
No response