-
-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
aiohttp middleware and replacing a request in flight #3097
Comments
There is something wrong if you cannot use redirects on your site.
|
It's not a site, it's an API that will be exposed to IoT devices that won't be able to redirect to another url. |
I see nothing bad with registering a handler twice than. |
Can I get a yes or no answer on whether or not the technical question I am asking is possible? |
Well, if you insist. |
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a [new issue] for related bugs. |
Hi, I am trying to build a middleware that attempts to automatically add slashes to the end of uris that are missing them to avoid having to double-define all my routes with and without a trailing slash to ensure no one 404s. I saw your normalize_path_middleware and started with that, but I can't use anything that's going to force a redirect on the client. I need to be able to accomplish the same thing entirely on the server side.
Here's my attempt at that middleware, which just clones the request with a new rel_url and passes that along, but I still am getting 404s when I don't include a trailing backslash in my uris. Any ideas? Thanks.
And here is a sample class that implements it.
The text was updated successfully, but these errors were encountered: