postmanlabs / httpbin

HTTP Request & Response Service, written in Python + Flask.
https://httpbin.org
ISC License
12.85k stars 1.82k forks source link

get using http returns https url #545

Open peppy opened 5 years ago

peppy commented 5 years ago

Visiting http://httpbin.org/get will give a response specifying the url is (incorrectly) https.

{
  "args": {}, 
  "headers": {
    "Accept": "text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3", 
    "Accept-Encoding": "gzip, deflate", 
    "Accept-Language": "en-AU,en;q=0.9,en-US;q=0.8,ja;q=0.7", 
    "Dnt": "1", 
    "Host": "httpbin.org", 
    "Upgrade-Insecure-Requests": "1", 
    "User-Agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/73.0.3683.86 Safari/537.36"
  }, 
  "origin": 
  "url": "https://httpbin.org/get" <--- incorrect
}
richthegeek commented 5 years ago

Confirmed that this is happening for me, and caused a test failure. I assume there is some enforced redirect on the server occurring.

gajus commented 5 years ago

@kenneth-reitz Can this be marked as a bug?

ghost commented 5 years ago

As an alternative this site offers both protocols: