Passer au contenu

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.

demandé il y a 4 ans256 vues

1 réponse
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

répondu il y a 2 ans

Vous n'êtes pas connecté. Se connecter pour publier une réponse.

Une bonne réponse répond clairement à la question, contient des commentaires constructifs et encourage le développement professionnel de la personne qui pose la question.