Comments (5)
Hi @Dilski! Thanks for opening this potential bug.
I'm working to reproduce this error and will update this issue as soon as I have an update.
from powertools-lambda-python.
@leandrodamascena just for extra info, we were doing this with a private API gateway and so tested with test invoke on the console
from powertools-lambda-python.
@leandrodamascena just for extra info, we were doing this with a private API gateway and so tested with test invoke on the console
This was the missing piece of this puzzle! I could not reproduce this either in my local environment or on the Swagger/Public/Private endpoint. However, using the APIGW "Test" on the console I was able to reproduce it.
This is a very specific bug and thanks a lot for catching and reporting this. Testing your APIs thought AWS Console it will send to Lambda the exact string you added in the Headers section, and in this case the string is:
"headers": {
"Content-Type": " application/json"
},
"multiValueHeaders": {
"Content-Type": [
" application/json"
]
},
If you see, there is a space before the application/json
string and it fails in this line. It looks like the solution is to remove the spaces before checking the header, something like this if not content_type_value or content_type_value.strip().startswith("application/json"):
. While we create a PullRequest and release a version to fix this, you can test using the header with no space between key and value: Content-Type:application/json
.
We are planning to release a version on February 8th. Please let me know if it is enough for you to wait until then or need this fix immediately.
Thanks.
from powertools-lambda-python.
⚠️ COMMENT VISIBILITY WARNING⚠️
This issue is now closed. Please be mindful that future comments are hard for our team to see.
If you need more assistance, please either tag a team member or open a new issue that references this one.
If you wish to keep having a conversation with other community members under this issue feel free to do so.
from powertools-lambda-python.
This is now released under 2.33.0 version!
from powertools-lambda-python.
Related Issues (20)
- Maintenance: fix and improve e2e tests for Data Masking utility HOT 2
- RFC: Support OpenAPI generation for micro functions via CLI/script HOT 5
- Bug: APIGatewayProxyEventV2.decoded_body should not cause KeyError HOT 3
- Feature request: On batch processing, fill in processor result even if BatchProcessingError is raised HOT 5
- Maintenance: Enable Redis e2e tests HOT 3
- Allow logging additional keys as a context manager HOT 8
- Nathan Hanks: Boost App Engagement with AWS CloudWatch Metrics & Powertools for AWS HOT 3
- Maintenance: revert AWS CDK as a development dependency HOT 1
- Bug: OpenAPI schema invalid when using Pydantic v2 (latest) HOT 10
- Bug: APIGatewayHttpResolver with validation enabled returns HTTP 422 when using single value query parameters HOT 15
- Bedrock Agent resolver security assessment HOT 4
- Bedrock Agents resolver blog post HOT 1
- Static typing: headers in Response should be Mapping instead of Dict HOT 3
- Maintenance: Refactor artifact name strategy for parallel uploads HOT 5
- Maintenance: Roadmap update HOT 3
- Bug: Logs populating into cloudwatch as multiple lines instead of a single object HOT 10
- Maintenance: Update readme to style badge and remove email HOT 3
- Maintenance: Layer ARN release update is partially working HOT 4
- Bug: payload validation is skipped when item is returned via `ReturnValuesOnConditionCheckFailure` HOT 11
- Docs: remove leftover announcement banner HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from powertools-lambda-python.