awsdocs/elastic-beanstalk-samples

Forcing HTTPS for POST

Closed this issue · 1 comments

Maybe I'm not understanding something about how this should work. But I recently used the great .config file located here:

https://github.com/awsdocs/elastic-beanstalk-samples/blob/master/configuration-files/aws-provided/resource-configuration/alb-http-to-https-redirection.config

To configure my Elastic Beanstalk instance to force all HTTP (port 80) traffic to HTTPS (port 443). And, for the most part, it seems to be working great.

However, my app is a Node Express API, and I just noticed that this solution is not working for requests that are not GET. Specifically, I create a POST request to http://api.permissionator.com/register in Postman. The response I get from my API is that it Cannot GET /register. When I look at the Postman console, it shows that a POST was received at http://api.permissionator.com/register and a 301 was returned. Because I have "follow redirects" enabled, Postman then creates a second request to https://api.permissionator.com:443/register. However, the second request is a GET.

Is this some kind of flaw with Postman??

Actually... I guess this might be "standard" or "expected" behavior, as explained here:

https://support.postman.com/hc/en-us/articles/211913929-I-sent-a-POST-request-but-Postman-seems-to-be-sending-a-GET-request-