I have a lambda that loads an S3 file and returns it as a Base64:
return {
"isBase64Encoded": True,
'statusCode': 200,
'body': b64encode(...).decode('utf-8'),
'headers': {
'Content-Type': 'application/octet-stream',
}
}
I created an API Gateway and when I call it I get:
<Response [200]>
Content-Type application/octet-stream
Content-Length 998356
apparent_encoding ascii
But calling the function URL returns:
<Response [200]>
Content-Type application/octet-stream
Content-Length 748765
apparent_encoding None
The correct content-length header value is the one API gateway is returning however the header is different when using the function URL even though they are both linked to the same Lambda function version & are invoking the same exact code.
What is the issue?