REST and HTTP client gives CloudFront 403 response

Answered

Been trying to use the REST or HTTP client to test some api endpoints, on a localhost server running node express. When I try to use the either client it gives a 400 or 403.

I've tried the following to fix this:

  1. Try a different api.
  2. Change localhost servers  port.
  3. Turn off Apache / reset my hosts file.
  4. Update to latest version of phpStorm

Here are the request headers when I try the phpStorm example and my localhost server. 

GET https://httpbin.org/ip

HTTP/1.1 400 Bad Request
Server: CloudFront
Date: Sun, 30 Dec 2018 09:01:49 GMT
Content-Type: text/html
Content-Length: 556
Connection: close
X-Cache: Error from cloudfront
Via: 1.1 b3cdc799ddae1752ea5fdd97d1367bba.cloudfront.net (CloudFront)
X-Amz-Cf-Id: I47fIk8HHu9k4tfNprRf9bVwqestmpZYuL6MAvAx-913x_RPaKNU3A==

GET http://localhost:3001/users

HTTP/1.1 403 Forbidden
Server: CloudFront
Date: Sun, 30 Dec 2018 09:03:05 GMT
Content-Type: text/html
Content-Length: 556
Connection: keep-alive
X-Cache: Error from cloudfront
Via: 1.1 68c17bb482a09fbeae0b042d2b84af05.cloudfront.net (CloudFront)
X-Amz-Cf-Id: GDeYJdJIIrkknLh_sawAOAqeQTjMhfVhJV0uG8fzEuFG10_kPIqNPw==
3 comments

Do you have PhpStorm installed on a remote machine (AWS)? 

It looks like a networking/DNS issue: machine where PhpStorm is installed is unable to resolve hostnames correctly.

Check that you don't have proxy specified at File | Settings | Appearance & Behavior | System Settings | HTTP Proxy.

1

Thanks I did have a proxy set that I had forgotten about.

1

Please sign in to leave a comment.