我有一个lambda,它加载一个S3文件并将其作为Base64返回:
return {
"isBase64Encoded": True,
'statusCode': 200,
'body': b64encode(...).decode('utf-8'),
'headers': {
'Content-Type': 'application/octet-stream',
}
}
我创建了一个API网关,当我调用它时,我得到:
<Response [200]>
Content-Type application/octet-stream
Content-Length 998356
apparent_encoding ascii
但是调用函数URL会返回:
<Response [200]>
Content-Type application/octet-stream
Content-Length 748765
apparent_encoding None
正确的content-length
报头值是API网关返回的值,但是使用函数URL时报头不同,即使它们都链接到相同的Lambda函数版本&;正在调用相同的代码.
问题是什么?