Conversation
### Description This ticket adds the `Access-Control-Allow-Origin` and `Access-Control-Allow-Headers` to the Feedback API's preflight requests. This resolves the CORS issue that caused an outage on 2025-08-26 (see [outage doc](https://docs.google.com/document/d/1-8EyzvyVEpYxSif-pfJ0rft4E-yI9-PBpPu-18R44wA/edit?tab=t.0#heading=h.ks8pez39zxhe)). Additionally, adds units tests for the rating/comment/email Lambda handlers to check that CORS headers are being included in the response. ### Testing strategy #### Unit tests 1. `npm install` 2. `npm run test` ##### Steps to test Test the dev API deployment in the browser by running the front-end feedback widget component locally and redirecting its API requests to the dev API Gateway URL: 1. Clone the [feedback-widget](https://github.com/newjersey/feedback-widget) repo. 2. Update the [`API_URL` in feedback-widget.js](https://github.com/newjersey/feedback-widget/blob/52d7f6d10518ed721b232112421d46a1deb18593/feedback-widget.js#L64) to the dev API Gateway URL. - To find the URL in the AWS Console, first make sure you're logged into the Innov-Platform-Dev account! Then search "API Gateway" -> click "Feedback API" in the list of APIs -> click "Stages" in the sidebar -> "Invoke URL" under "Stage details" 3. Open the `feedback-widget.html` in the browser — you should see a page containing just the frontend feedback widget component. Test that submiting a rating/comment/email works (use the network tab to ensure requests are being sent to the dev API URL and are returning a success response). **Note: Submitting feedback via the widget will write to the production feedback Google Sheet.** Please delete them from the sheet after testing if you have access, or ask a Platforms engineer to do so for you. ### Additional resources - ["Enabling CORS for a non-simple request" (AWS docs)](https://docs.aws.amazon.com/apigateway/latest/developerguide/how-to-cors.html#apigateway-enable-cors-non-simple).
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Merges the following PR to main: