跳至内容

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.

已提问 4 年前259 查看次数

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 年前

您未登录。 登录 发布回答。

一个好的回答可以清楚地解答问题和提供建设性反馈,并能促进提问者的职业发展。