You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* The implementation looks complete and well-structured. The changes add the new feature of configurable error status codes via the `AWS_LWA_ERROR_STATUS_CODES` environment variable, with support for both individual codes and ranges.
Key points about the implementation:
1. Backward compatibility is maintained
2. Supports comma-separated status codes and ranges
3. Gracefully handles invalid input
4. Added parsing and testing for status code parsing
5. Integrated into the existing `fetch_response` method
The code is ready to be committed. Would you like me to generate a commit message for these changes?
* fix: Resolve type inference errors in parse_status_codes tests
* docs: Add AWS_LWA_ERROR_STATUS_CODES configuration to README
* docs: Add documentation for AWS_LWA_ERROR_STATUS_CODES environment variable
* Solve linting error
* Solve the cargo warming
* test: Add integration test for HTTP error status codes handling
* feat: Add warning logs for status code parsing failures
Copy file name to clipboardExpand all lines: README.md
+3Lines changed: 3 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -105,6 +105,7 @@ The readiness check port/path and traffic port can be configured using environme
105
105
| AWS_LWA_INVOKE_MODE | Lambda function invoke mode: "buffered" or "response_stream", default is "buffered" | "buffered" |
106
106
| AWS_LWA_PASS_THROUGH_PATH | the path for receiving event payloads that are passed through from non-http triggers | "/events" |
107
107
| AWS_LWA_AUTHORIZATION_SOURCE | a header name to be replaced to `Authorization`| None |
108
+
| AWS_LWA_ERROR_STATUS_CODES | comma-separated list of HTTP status codes that will cause Lambda invocations to fail (e.g. "500,502-504,422") | None |
108
109
109
110
> **Note:**
110
111
> We use "AWS_LWA_" prefix to namespacing all environment variables used by Lambda Web Adapter. The original ones will be supported until we reach version 1.0.
@@ -137,6 +138,8 @@ Please check out [FastAPI with Response Streaming](examples/fastapi-response-str
137
138
138
139
**AWS_LWA_AUTHORIZATION_SOURCE** - When set, Lambda Web Adapter replaces the specified header name to `Authorization` before proxying a request. This is useful when you use Lambda function URL with [IAM auth type](https://docs.aws.amazon.com/lambda/latest/dg/urls-auth.html), which reserves Authorization header for IAM authentication, but you want to still use Authorization header for your backend apps. This feature is disabled by default.
139
140
141
+
**AWS_LWA_ERROR_STATUS_CODES** - A comma-separated list of HTTP status codes that will cause Lambda invocations to fail. Supports individual codes and ranges (e.g. "500,502-504,422"). When the web application returns any of these status codes, the Lambda invocation will fail and trigger error handling behaviors like retries or DLQ processing. This is useful for treating certain HTTP errors as Lambda execution failures. This feature is disabled by default.
142
+
140
143
## Request Context
141
144
142
145
**Request Context** is metadata API Gateway sends to Lambda for a request. It usually contains requestId, requestTime, apiId, identity, and authorizer. Identity and authorizer are useful to get client identity for authorization. API Gateway Developer Guide contains more details [here](https://docs.aws.amazon.com/apigateway/latest/developerguide/set-up-lambda-proxy-integrations.html#api-gateway-simple-proxy-for-lambda-input-format).
0 commit comments