2 Antworten
- Neueste
- Die meisten Stimmen
- Die meisten Kommentare
0
Adding this answer to mark as most helpful: As suggested in a comment to another answer, the WAF had protections that was blocking the request.
beantwortet vor 7 Monaten
0
Changing only the content -> text field to this { "id": "12345", "type": "info", "content": [ { "type": "text", "text": "<p style=""> Text </p>", "action": "add" } ], "title": "Title" } or { "id": "12345", "type": "info", "content": [ { "type": "text", "text": "<p style="color: rgb(230, 0, 0);">red text</p>", "action": "add" } ], "title": "Title" }
Are those inputs well-formatted JSON?
Look like you need to replace the double quotes in <p>
element to the single quotes, as below.
{ "id": "12345", "type": "info", "content": [ { "type": "text", "text": "<p style=''> Text </p>", "action": "add" } ], "title": "Title" }
{ "id": "12345", "type": "info", "content": [ { "type": "text", "text": "<p style='color: rgb(230, 0, 0);'>red text</p>", "action": "add" } ], "title": "Title" }
beantwortet vor 8 Monaten
Relevanter Inhalt
- AWS OFFICIALAktualisiert vor 8 Monaten
- AWS OFFICIALAktualisiert vor 2 Jahren
- AWS OFFICIALAktualisiert vor 2 Jahren
- AWS OFFICIALAktualisiert vor 2 Jahren
I should have mentioned that I had already tried changing to single quotes, but using "<p style=''> Text </p>" and "<p style='color: rgb(230, 0, 0);'>red text</p>" also error
Does your API Gateway return an 200 response with "Access-Control-Allow-Origin" header if you test the method with the problematic inputs on the AWS Console? https://docs.aws.amazon.com/apigateway/latest/developerguide/how-to-test-method.html
Yes, using the AWS console with the problematic inputs succeeds with a 200 response, and returns the headers including Access-Control-Allow-Origin.
Hmm. Does your API Gateway have some protections (e.g., WAF)? The only possibility otherwise I can imagine is that some protections blocked your request and returned an error response without the CORS headers, so that the error message
No 'Access-Control-Allow-Origin' header is present on the requested resource.
arised.The WAF was the issue. Thank you for this suggestion