-
-
Notifications
You must be signed in to change notification settings - Fork 129
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
rawQueryString
seems to be a string instead of bytes literals
#105
Comments
@vincentsarago thanks for the detailed description of the issue. :) I had a look, a bytes string is being suppled for the I'll update this issue when the changes are in. |
These changes are now in master, dc14a00#diff-12d2884e46108e48b62f0482aa6988d3R104. I'll see about a pre-release later tonight or tomorrow (still want to do some more testing of the latest batch of changes before pushing 0.9.0). |
Actually I ended up just pushing the 0.9.0 release (includes this change). Please follow-up if you run into any further issues. |
thanks a lot @ERM I will test it right away :-) |
Everything works now 😄 🎉 |
👋 @ERM, first let me thank you for this
greatawesome library, as the author of anotherproxy
for aws lambda I know this can be a 🕳️ sometimes.I'm currently working on https://github.com/developmentseed/titiler which is a FastAPI based tile server. When deploying the lambda function using mangum and the new api gateway HTTP endpoint, most of my endpoints works except for the ones where I call
request.url.scheme
e.g: https://github.com/developmentseed/titiler/blob/master/titiler/api/api_v1/endpoints/metadata.py#L59
and I get
AttributeError: 'str' object has no attribute 'decode'
Logs
So looking at my cloudwatch logs I can deduce:
in https://github.com/encode/starlette/blob/97257515f8806b8cc519d9850ecadd783b3008f9/starlette/datastructures.py#L45 starlette expect the
query_string
to be a byte literalin https://github.com/erm/mangum/blob/4fbf1b0d7622c19385a549eddfb603399a125bbb/mangum/adapter.py#L100-L106
it seems that Mangum is getting the
rawQueryString
for the event, and in my case I think this would be a string instead of a byte literal.I'll work on adding logging and test in my app to confirm this, but I wanted to share this to see if I was making sense ;-)
Thanks
The text was updated successfully, but these errors were encountered: