dlang-requests icon indicating copy to clipboard operation
dlang-requests copied to clipboard

bug: input GET params duplicated on the actual request url

Open mw66 opened this issue 1 year ago • 1 comments

with v2.0.9.

Very simple code:

  auto headers = [
    "Content-Type": "application/json"
  ];
  auto rq = Request();
  rq.verbosity = 2;
  rq.addHeaders(headers);
  auto resp = rq.get(url);

if the url has single GET param:

url = "https://api.tiingo.com/iex?token=KEY"

// logs:
...
< location: /iex/?token=KEY
...
> GET /iex/?token=KEY?token=KEY HTTP/1.1

this will result in resp: {"detail":"Invalid token."}

if the url has two GET params:

url = "https://api.tiingo.com/iex?format=csv&token=KEY"

// logs:
...
< location: /iex/?format=csv&token=KEY
...
> GET /iex/?format=csv&token=KEY?format=csv&token=KEY HTTP/1.1

this will succeed.

From the logs: looks like the params are duplicated on the actual GET HTTP/1.1.

mw66 avatar Jun 06 '23 01:06 mw66