Skip to content

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 Answer
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
answered a year ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.