We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Originally from: Miserlou/Zappa#2077 by ebertti
When the url has some querystring like:
http://domain.com/path/to/view/?query=some%40mail.com
django wait to receive this:
def some_view(request): query = request.GET.get('query') assert query == 'some@mail.com'
with Zappa 0.51.0 and Django 3.0.5 and python 3.7 on Lambda and ALB
this is the actual behavior
def some_view(request): query = request.GET.get('query') assert query == 'some%40mail.com'
So I made this small middleware to quick fix:
class FixQueryStringZappaMiddleware: def __init__(self, get_response): self.get_response = get_response def __call__(self, request): if os.envirion('FRAMEWORK') == 'Zappa': querystring = request.GET.urlencode() u = urllib.parse.unquote(querystring) request.GET = QueryDict(u) response = self.get_response(request) return response
and add this middleware as first of your list of middlewares
this is my zappa_settings.json
{ "project": { "project_name": "project-backend", "aws_region": "sa-east-1", "alb_enabled": true, "apigateway_enabled": false, "cors": true, "keep_warm": false, "touch": false, "runtime": "python3.7", "timeout_seconds": 900, "log_level": "INFO", "s3_bucket": "some-bucket", "delete_s3_zip": false, "debug": true } }
The text was updated successfully, but these errors were encountered:
I think I'm experiencing a similar issue.
I think it might just be an ALB issue?
Wouldn't it be better to modify ZappaWSGIMiddleware to fix the encoding issue?
ZappaWSGIMiddleware
Sorry, something went wrong.
considered a duplicate of #879
closing
No branches or pull requests
Originally from: Miserlou/Zappa#2077 by ebertti
When the url has some querystring like:
http://domain.com/path/to/view/?query=some%40mail.com
django wait to receive this:
with Zappa 0.51.0 and Django 3.0.5 and python 3.7 on Lambda and ALB
this is the actual behavior
So I made this small middleware to quick fix:
and add this middleware as first of your list of middlewares
this is my zappa_settings.json
The text was updated successfully, but these errors were encountered: