0

I'm running an ubuntu docker container on a MacOS host.

I have the oracle-pab server running in a nix-shell, but when I try to run the oracle-client executable, I get this error:

[nix-shell:/src/plutus-pioneer-program/code/week06]# cabal run oracle-client
Up to date
oracle contract instance id: 3df07760-c749-4e10-9c7d-83c44ea12364
oracle-client: VanillaHttpException (HttpExceptionRequest Request {
  host                 = "coinmarketcap.com"
  port                 = 443
  secure               = True
  requestHeaders       = []
  path                 = "/currencies/cardano"
  queryString          = ""
  method               = "GET"
  proxy                = Nothing
  rawBody              = False
  redirectCount        = 10
  responseTimeout      = ResponseTimeoutDefault
  requestVersion       = HTTP/1.1
}
 (StatusCodeException (Response {responseStatus = Status {statusCode = 403, statusMessage = "Forbidden"}, 
responseVersion = HTTP/1.1, responseHeaders = [("Date","Wed, 08 Sep 2021 04:31:25 GMT"),("Content-Type","text/plain; charset=UTF-8"),
("Content-Length","16"),("Connection","keep-alive"),("X-Frame-Options","SAMEORIGIN"),
("Cache-Control","private, max-age=0, no-store, no-cache, must-revalidate, post-check=0, pre-check=0"),("Expires","Thu, 01 Jan 1970 00:00:01 GMT"),
("Expect-CT","max-age=604800, report-uri=\"https://report-uri.cloudflare.com/cdn-cgi/beacon/expect-ct\""),("Vary","Accept-Encoding"),
("Server","cloudflare"),("CF-RAY","68b5727a4fdeff98-CGK")], responseBody = (), responseCookieJar = CJ {expose = []},
 responseClose' = ResponseClose}) "error code: 1020"))

however, if I run curl from the same command line, it works. However, curl requires the -L option to follow redirects, otherwise it just returns html for Permanently Moved.

 curl -i -L 'https://coinmarketcap.com/currencies/cardano'

Why does the haskell client get a 403 code from the target server, where the same request from curl does not?

Update: I just noticed that the haskell library is sending the request under version HTTP/1.1, whereas curl sends the request with HTTP/2. Is it possible this is the difference?

And if so, is it possible to get the Haskell version updated to HTTP/2?

1
  • It can't be that coinmarketcap just moved the cardano page, but there some difference between how curl sends the request and how the haskell library sends the request.
    – marcel_g
    Sep 8 at 8:54

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.