mangum
mangum copied to clipboard
Allow Mangum to remove certain aws reponse headers from api gateway response
Problem:
Currently Mangum
injects the following headers in the api gateway response for an aws lambda integration
x-amz-apigw-id
x-amzn-requestid
x-amzn-trace-id
This exposes additional information that the client doesn't need to know.
Proposal:
Allow Mangum to take optional parameter say exclude_header_keys=[]
at the application mounting step.
An Example of that would look like.
from fastapi import FastAPI
app = FastAPI()
handler = Mangum(app, exclude_header_keys=[]
Hi @amieka,
I've given this some thought and decided it should okay to include this new parameter - let's go with a new parameter named exclude_headers
.
Would you be able to create a PR?
Hi @jordaneremieff I can take a stab it. Thank you