我正在使用 AWS API Gateway 及其 HTTP 代理。
我需要将CloudFront-Viewer-Country标头传递给我的端点。我尝试按照以下问题Access headers in AWS API Gateway using HTTP Proxy 中概述的相同设置进行尝试
?
我在端点服务器上收到以下标头。
Array
(
[host] => example.com
[Accept] => application/json
[User-Agent] => AmazonAPIGateway_c8752844lh
[x-amzn-apigateway-api-id] => c8752844lh
[X-Amzn-Trace-Id] => Root=1-59bd7a5e-003ef07b3c4c3680299801f1
[X-Forwarded-For] => xx.xxx.xx.xxx
[X-Forwarded-Port] => 443
[X-Forwarded-Proto] => https
[Connection] => keep-alive
)Run Code Online (Sandbox Code Playgroud)
然而,CloudFront-Viewer-Country不在其中。如果我使用 lambda 函数而不是 HTTP 代理,我可以看到更多的标头(包括CloudFront-Viewer-Country)。
谁能告诉我如何使用 HTTP 代理访问端点上所需的标头?