mr-cloud / test

0 stars 0 forks source link

Empty cookie header sent on get #88

Closed mr-cloud closed 2 years ago

mr-cloud commented 2 years ago

If i send this request: requests.get("http://localhost:9001/toggle/12345")

nc reports this:

Listening on [0.0.0.0] (family 0, port 9001)
Connection from localhost 54734 received!
GET /toggle/12345 HTTP/1.1
User-Agent: requests-scala
Accept-Encoding: gzip, deflate
Accept: */*
Cookie: 
Cache-Control: no-cache
Pragma: no-cache
Host: localhost:9001
Connection: keep-alive

The empty Cookie header seems to be out of spec: https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Cookie and Akka-http doesn't like it either.

Adding a fake cookie makes Akka-http happier. ID: 33 Original Author: marklister link: Original Link

mr-cloud commented 2 years ago

Reproduced with requests.get("https://httpbin.org/headers")

{
  "headers": {
    "Accept": "*/*",
    "Accept-Encoding": "gzip, deflate",
    "Cache-Control": "no-cache",
    "Cookie": "",
    "Host": "httpbin.org",
    "Pragma": "no-cache",
    "User-Agent": "requests-scala"
  }
}

Original Author:Magua