質問編集履歴

1

CORSを有効化した際の画像を追加しました。

2022/08/25 09:03

投稿

kanieksuke
kanieksuke

スコア33

test CHANGED
File without changes
test CHANGED
@@ -1,6 +1,6 @@
1
1
  ### 前提
2
2
 
3
- 顧客情報を入力して登録すると、
3
+ 顧客情報を入力して送信すると、
4
4
  API Gateway REST APIからLambda関数を呼び出し、DynamoDBに保存する機能を作っています。
5
5
 
6
6
  ### 発生している問題・エラーメッセージ
@@ -8,7 +8,12 @@
8
8
  送信時、以下のエラーメッセージをコンソールで吐き続けています。
9
9
 
10
10
  ```
11
- Access to fetch at 'https://xxxxxxxx.execute-api.ap-northeast-1.amazonaws.com/prod/customers' from origin 'https://xxxxxxxxx.s3.ap-northeast-1.amazonaws.com' has been blocked by CORS policy: Response to preflight request doesn't pass access control check: No 'Access-Control-Allow-Origin' header is present on the requested resource. If an opaque response serves your needs, set the request's mode to 'no-cors' to fetch the resource with CORS disabled.
11
+ Access to fetch at 'https://xxxxxxxx.execute-api.ap-northeast-1.amazonaws.com/prod/customers'
12
+ from origin 'https://xxxxxxxxx.s3.ap-northeast-1.amazonaws.com' has been blocked by CORS policy:
13
+ Response to preflight request doesn't pass access control check:
14
+ No 'Access-Control-Allow-Origin' header is present on the requested resource.
15
+ If an opaque response serves your needs,
16
+ set the request's mode to 'no-cors' to fetch the resource with CORS disabled.
12
17
  ```
13
18
 
14
19
  ### 顧客情報入力画面で働くJS
@@ -86,4 +91,6 @@
86
91
 
87
92
  ![イメージ説明](https://ddjkaamml8q8x.cloudfront.net/questions/2022-08-25/d8620057-083a-40e9-a46a-f0b9c8f264d1.png)
88
93
 
94
+ ![イメージ説明](https://ddjkaamml8q8x.cloudfront.net/questions/2022-08-25/006c2197-2782-4510-883c-a3c590eeecf1.png)
95
+
89
96
  何卒、お知恵をお貸し頂けると有り難いです。。