- 最新
- 投票最多
- 评论最多
Based on the information provided, it appears you're experiencing an issue where the User-Agent header is not being included in the event context passed to your S3 Object Lambda function.
When S3 Object Lambda passes request context to Lambda functions, it includes various fields including headers from the original call. However, authorization-related headers are explicitly excluded from this context. It's possible that the User-Agent header is being treated as an authorization-related header or is being filtered out for security reasons.
The event context documentation confirms that certain headers may be excluded, specifically mentioning "excluding any authorization-related headers." While User-Agent isn't typically considered an authorization header, AWS might be filtering it out as part of their security practices.
To address this issue, you have a few options:
-
Consider if you truly need the User-Agent information for your use case. If possible, design your solution to work without relying on this specific header.
-
If the User-Agent is critical for your application, you might need to pass this information through alternative means, such as including it as part of your object metadata or as a custom parameter in your request.
-
Check if there are any configuration options for your S3 Object Lambda Access Point that might allow you to include additional headers in the context.
The headers that are passed through to the Lambda function are limited to non-authorization headers, and it appears that User-Agent may be among those that are filtered out by default.
Sources
Event context format and usage - Amazon Simple Storage Service
相关内容
- AWS 官方已更新 1 年前
