Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

HEAD requests make "Error: unexpected end of file" #319

Closed
Sangdol opened this issue Jan 28, 2016 · 6 comments
Closed

HEAD requests make "Error: unexpected end of file" #319

Sangdol opened this issue Jan 28, 2016 · 6 comments
Assignees
Labels

Comments

@Sangdol
Copy link

Sangdol commented Jan 28, 2016

When I try to make a HTTP HEAD request, Newman makes an error:

Error: unexpected end of file
  at Zlib._handle.onerror (zlib.js:363:17)

The request works well in Postman. You can test it with this collection URL https://www.getpostman.com/collections/d5ec4973f044fe002171, which sends HEAD requests to google.com, github.com, and amazon.com.

$ newman -u https://www.getpostman.com/collections/d5ec4973f044fe002171

Thank you.

@czardoz
Copy link
Contributor

czardoz commented Jan 28, 2016

Works fine for me:

newman -u https://www.getpostman.com/collections/d5ec4973f044fe00217

Iteration 1 of 1
200 239ms google [HEAD] http://google.com
200 1708ms github [HEAD] http://github.com
405 1031ms amazon [HEAD] http://amazon.com

Summary:

Parent                      Pass Count   FailCount
-------------------------------------------------------------
Collection Head test                 0           0

Total                                0           0

@czardoz
Copy link
Contributor

czardoz commented Jan 28, 2016

What's your Newman version? Are you behind a corporate proxy or something?

@Sangdol
Copy link
Author

Sangdol commented Jan 29, 2016

I'm not behind any proxy. I tried with these combinations but nothing worked.

  • Newman 1.2.28 + Node 5.0
  • Newman 2.0.0-beta.6 + Node 5.0
  • Newman 2.0.0-beta.6 + Node 5.3

Newman works well with GET or POST requests.

$ newman -u https://www.getpostman.com/collections/d5ec4973f044fe002171

Iteration 1 of 1
RequestError: [560b16fe-b43b-7053-036a-1ff5b8103ee7] 'google' terminated. Complete error:
Error: unexpected end of file
    at Zlib._handle.onerror (zlib.js:363:17)
RequestError: [9016e3df-2a4e-10e9-b22c-81f6d0f584ec] 'github' terminated. Complete error:
Error: unexpected end of file
    at Zlib._handle.onerror (zlib.js:363:17)
RequestError: [8b850a44-e1ca-7088-d9f1-d42afb3f8a56] 'amazon' terminated. Complete error:
Error: unexpected end of file
    at Zlib._handle.onerror (zlib.js:363:17)

Summary:

Parent                      Pass Count   FailCount
-------------------------------------------------------------
Collection Head test                 0           0

Total                                0           0

$ newman -u https://www.getpostman.com/collections/9efe5601c5849ab43288

Iteration 1 of 1
200 373ms google [GET] http://google.com
200 1316ms github [GET] http://github.com
200 2402ms amazon [GET] http://amazon.com

Summary:

Parent                      Pass Count   FailCount
-------------------------------------------------------------
Collection GET test                  0           0

Total                                0           0

Node 5+ could be the cause of this problem?

@czardoz
Copy link
Contributor

czardoz commented Jan 29, 2016

Looks like yes. This seems to be an issue in https://www.npmjs.com/package/request (which newman uses internally).

I will do some further investigation before opening an issue on the downstream.

@czardoz
Copy link
Contributor

czardoz commented Jan 29, 2016

Opened an issue with the downstream: request/request#2045

@Sangdol
Copy link
Author

Sangdol commented Jan 30, 2016

Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants