OPTIONS http methods gives an empty response on Heroku

前端 未结 2 894
一生所求
一生所求 2021-01-19 17:37

When I do things locally my CORS calls are working fine

$ curl -i -X OPTIONS \"http://localhost:3000/api/v1/login\"
HTTP/1.1 200 OK
X-Powered-By: Express
Acc         


        
2条回答
  •  遥遥无期
    2021-01-19 18:12

    Getting no response might be caused by configuration similar to this:

    if ($request_method !~ ^(GET|HEAD|POST|PUT|DELETE)$ ) {
        return 444;
    }
    

    Which means that nginx will close the connection without a proper response, that's why this is so difficult to debug.

    Search your configuration for the 444 return code. If you find something like the above, just add OPTIONS to the list).

提交回复
热议问题