mrkkrp / req

An HTTP client library
Other
337 stars 40 forks source link

Failing httpbin-tests #58

Closed qrilka closed 5 years ago

qrilka commented 5 years ago

Probably something has changed on httpbin.org - it looks like it doesn't send Connection: close header anymore so the tests using it start to fail:

Failures:

  httpbin-tests/Network/HTTP/ReqSpec.hs:67:7: 
  1) Network.HTTP.Req, receiving request headers back, works
       expected: Object (fromList [("headers",Object (fromList [("Accept-Encoding",String "gzip"),("Connection",String "close"),("Foo",String "bar"),("Baz",String "quux"),("Host",String "httpbin.org")]))])
        but got: Object (fromList [("headers",Object (fromList [("Accept-Encoding",String "gzip"),("Foo",String "bar"),("Baz",String "quux"),("Host",String "httpbin.org")]))])

  To rerun use: --match "/Network.HTTP.Req/receiving request headers back/works/"

  httpbin-tests/Network/HTTP/ReqSpec.hs:80:7: 
  2) Network.HTTP.Req, receiving GET data back, works
       expected: Object (fromList [("args",Object (fromList [])),("url",String "https://httpbin.org/get"),("headers",Object (fromList [("Accept-Encoding",String "gzip"),("Connection",String "close"),("Host",String "httpbin.org")]))])
        but got: Object (fromList [("args",Object (fromList [])),("url",String "https://httpbin.org/get"),("headers",Object (fromList [("Accept-Encoding",String "gzip"),("Host",String "httpbin.org")]))])

  To rerun use: --match "/Network.HTTP.Req/receiving GET data back/works/"

  httpbin-tests/Network/HTTP/ReqSpec.hs:96:7: 
  3) Network.HTTP.Req, receiving POST JSON data back, works
       expected: Object (fromList [("args",Object (fromList [])),("json",String "foo"),("data",String "\"foo\""),("url",String "https://httpbin.org/post"),("headers",Object (fromList [("Content-Type",String "application/json; charset=utf-8"),("Accept-Encoding",String "gzip"),("Connection",String "close"),("Host",String "httpbin.org"),("Content-Length",String "5")])),("files",Object (fromList [])),("form",Object (fromList []))])
        but got: Object (fromList [("args",Object (fromList [])),("json",String "foo"),("data",String "\"foo\""),("url",String "https://httpbin.org/post"),("headers",Object (fromList [("Content-Type",String "application/json; charset=utf-8"),("Accept-Encoding",String "gzip"),("Host",String "httpbin.org"),("Content-Length",String "5")])),("files",Object (fromList [])),("form",Object (fromList []))])

  To rerun use: --match "/Network.HTTP.Req/receiving POST JSON data back/works/"

  httpbin-tests/Network/HTTP/ReqSpec.hs:120:7: 
  4) Network.HTTP.Req, receiving POST data back (multipart form data), works
       expected: Object (fromList [("args",Object (fromList [])),("json",Null),("data",String ""),("url",String "https://httpbin.org/post"),("headers",Object (fromList [("Content-Type",String "multipart/form-data; boundary=----WebKitFormBoundaryqF5ZRQWq6uj4q2w0"),("Accept-Encoding",String "gzip"),("Connection",String "close"),("Host",String "httpbin.org"),("Content-Length",String "242")])),("files",Object (fromList [])),("form",Object (fromList [("foo",String "foo data!"),("bar",String "bar data!")]))])
        but got: Object (fromList [("args",Object (fromList [])),("json",Null),("data",String ""),("url",String "https://httpbin.org/post"),("headers",Object (fromList [("Content-Type",String "multipart/form-data; boundary=----WebKitFormBoundaryqF5ZRQWq6uj4q2w0"),("Accept-Encoding",String "gzip"),("Host",String "httpbin.org"),("Content-Length",String "242")])),("files",Object (fromList [])),("form",Object (fromList [("foo",String "foo data!"),("bar",String "bar data!")]))])

  To rerun use: --match "/Network.HTTP.Req/receiving POST data back (multipart form data)/works/"

  httpbin-tests/Network/HTTP/ReqSpec.hs:147:7: 
  5) Network.HTTP.Req, receiving PATCHed file back, works
       expected: Object (fromList [("args",Object (fromList [])),("json",Null),("data",String "User-agent: *\nDisallow: /deny\n"),("url",String "https://httpbin.org/patch"),("headers",Object (fromList [("Accept-Encoding",String "gzip"),("Connection",String "close"),("Host",String "httpbin.org"),("Content-Length",String "30")])),("files",Object (fromList [])),("form",Object (fromList []))])
        but got: Object (fromList [("args",Object (fromList [])),("json",Null),("data",String "User-agent: *\nDisallow: /deny\n"),("url",String "https://httpbin.org/patch"),("headers",Object (fromList [("Accept-Encoding",String "gzip"),("Host",String "httpbin.org"),("Content-Length",String "30")])),("files",Object (fromList [])),("form",Object (fromList []))])

  To rerun use: --match "/Network.HTTP.Req/receiving PATCHed file back/works/"

  httpbin-tests/Network/HTTP/ReqSpec.hs:169:7: 
  6) Network.HTTP.Req, receiving PUT form URL-encoded data back, works
       expected: Object (fromList [("args",Object (fromList [])),("json",Null),("data",String ""),("url",String "https://httpbin.org/put"),("headers",Object (fromList [("Content-Type",String "application/x-www-form-urlencoded"),("Accept-Encoding",String "gzip"),("Connection",String "close"),("Host",String "httpbin.org"),("Content-Length",String "18")])),("files",Object (fromList [])),("form",Object (fromList [("foo",String "bar"),("baz",String "5"),("quux",String "")]))])
        but got: Object (fromList [("args",Object (fromList [])),("json",Null),("data",String ""),("url",String "https://httpbin.org/put"),("headers",Object (fromList [("Content-Type",String "application/x-www-form-urlencoded"),("Accept-Encoding",String "gzip"),("Host",String "httpbin.org"),("Content-Length",String "18")])),("files",Object (fromList [])),("form",Object (fromList [("foo",String "bar"),("baz",String "5"),("quux",String "")]))])

  To rerun use: --match "/Network.HTTP.Req/receiving PUT form URL-encoded data back/works/"

Randomized with seed 1847904547
mrkkrp commented 5 years ago

This is fixed now in master. Do you want me to do a release?

qrilka commented 5 years ago

That could make sense if you don't want to have req in expected-test-failures on Stackage and there's no upcoming release in the near future.

mrkkrp commented 5 years ago

Published version 2.0.1.