Unable to use X-Http-Method-Override header with Lambda Function URL

0

When trying to invoke a Lambda function through its function URL issuing a POST request with "X-Http-Method-Override" header set, the response is always HTTP 403 Forbidden with body:

<AccessDeniedException>
  <Message>Unable to determine service/operation name to be authorized</Message>
</AccessDeniedException>

Is there anything I can do to use this header to change the HTTP method? Alternatively, can I pass it to the function?

已提問 2 年前檢視次數 472 次
1 個回答
0

The link below provides details for accessing header info associated with Lambda function URLs. It has sample code to parse the passed header info, similar to how it is passed from API Gateway via the event structure when Lambdas are invoked in that manner. Your function URL Lambda can then invoke subsequent methods as needed. Function Lambda URL Headers

AWS
AWSdave
已回答 1 年前
  • Maybe it's not clear, but I cannot reach the function if I set that request header. I don't need to know how to retrieve its value, but how to execute the function with that header set.

  • Can you verify that the Auth Type is set to None on the Lambda?

  • Yes, the auth type is set to NONE

您尚未登入。 登入 去張貼答案。

一個好的回答可以清楚地回答問題並提供建設性的意見回饋,同時有助於提問者的專業成長。

回答問題指南