내용으로 건너뛰기

AWS Console - API gateway - Edit Authorizor - Save -> Network error.

0

Anyone else getting a network error in the AWS console when hitting save on an authorizer edit.

vendors.js:88608          PATCH https://apigateway.ap-southeast-2.amazonaws.com/v2/apis/0XXXXXXX9/authorizers/dXXXXw net::ERR_FAILED
handleRequest @ vendors.js:88608
<snip>
clickHandler @ vendors.js:6471
edit-attach:1 Access to XMLHttpRequest at 'https://apigateway.ap-southeast-2.amazonaws.com/v2/apis/0XXXXXXX9/authorizers/dXXXXw' from origin 'https://ap-southeast-2.console.aws.amazon.com' has been blocked by CORS policy: Method PATCH is not allowed by Access-Control-Allow-Methods in preflight response.
1개 답변
0

The error message indicates that there is a CORS (Cross-Origin Resource Sharing) issue. The PATCH request from the API Gateway console is being blocked due to the API Gateway not allowing the PATCH method in the Access-Control-Allow-Methods header.

To fix this issue, you will need to configure the CORS settings for your API Gateway to allow the PATCH method. Here are the steps:

  1. Go to the API Gateway console in the AWS Management Console.
  2. Navigate to the API you are working with.
  3. Go to the "Stages" section and select the stage you are working with (e.g., "prod", "dev", etc.).
  4. In the stage details, find the "CORS" section.
  5. Click on the "Edit" button to modify the CORS configuration.
  6. In the "Access-Control-Allow-Methods" field, add the "PATCH" method in addition to any other methods you have already configured (e.g., "GET, POST, PUT, DELETE, OPTIONS, HEAD, PATCH").
  7. Save the changes.
AWS

답변함 2년 전

로그인하지 않았습니다. 로그인해야 답변을 게시할 수 있습니다.

좋은 답변은 질문에 명확하게 답하고 건설적인 피드백을 제공하며 질문자의 전문적인 성장을 장려합니다.

관련 콘텐츠