-
Notifications
You must be signed in to change notification settings - Fork 43
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
URLs with spaces do not work #74
Comments
If you include the URL escaping within route it should work. server.appendRoute("/some%20folder") { _ in
HTTPResponse(
statusCode: .ok,
headers: [.contentType: "text/plain; charset=UTF-8"],
body: "📂".data(using: .utf8)!
)
} You can successfully request it via curl:
Are you wanting to include spaces in the route and have it automatically escaped and matched with server.appendRoute("/some folder") |
the problem is i'm trying to match the route with wildcard, its a directory with custom handler and path specified as "GET /fonts/*", but the actual requests are /fonts/Font%20Name/whatever. I could add iterating over the subfolders and files and adding the route handlers from there, but that seems like even trickier workaround :) |
I see, it's definitely a bug — The scenario I posted above works because both I'll take a deeper look |
Fixed on |
great, thanks a lot for the quick fix! |
0.13.0 was just released. 🙏🏻 |
Hello,
for one of my usecases i need url which uses percent encoded spaces, eg: http://host/some%20folder,
currently such url wont get matched and handled, far from ideal but i got around it for now by editing HTTPDecoder and replacing the "%20" with "+", then i get the route matched and handle it accordingly.
any ideas on how to solve it nicely?
thanks for the great work!
The text was updated successfully, but these errors were encountered: