Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
TestHandleApiRequest: use POST unsubscribe
This is in preparation for allowing only POST unsubscribe requests. The handler logic doesn't care what HTTP method is used to unsubscribe, which is why this test change didn't require any code changes. The /unsubscribe HTTP method is enforced by the CloudFormation template. Still, it's good for the test input to closely resemble what's expected from the configured API Gateway, even if it doesn't affect the handler logic. I mean, I could add logic to enforce the expected HTTP method for each API endpoint. Maybe that's not a bad idea. However, it will have to come after updating the system to point {{UnsubscribeUrl}} at a page with a web form. That, in fact, is why I'm diving into making sure `@` is encoded as `%40` and thinking of eliminating GET /unsubscribe. I accidentally unsubscribed myself by clicking on the unsubscribe link in an email. Updating {{UnsubscribeUrl}} to point to a form will allow the user to make sure they really intend to unsubscribe. This POST /unsubscribe will be less error prone while also being more semantically correct. (I think technically /verify should also be a POST, but it seems conventional to have such links always use GET.)
- Loading branch information