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

Unexpected error for HEAD and 404 URLs #1357

Closed
Kikobeats opened this issue Jul 12, 2020 · 2 comments
Closed

Unexpected error for HEAD and 404 URLs #1357

Kikobeats opened this issue Jul 12, 2020 · 2 comments
Labels
external The issue related to an external project

Comments

@Kikobeats
Copy link
Contributor

Kikobeats commented Jul 12, 2020

Hello,

I noted when a HEAD request is performed for a 404 URL, an unexpected error occurs.

Actual behavior

https://runkit.com/kikobeats/5f09864696e7a6001baff6a7

const got = require('got')
const pReflect = require('p-reflect')

const result = await pReflect(got.head('https://www.sachadrake.com/images/assetimages/social_media_default.jpg'))

console.log(result)

Expected behavior

If the same code is performed using GET instead of HEAD, got returns the error:

HTTPError: Response code 404 (Not Found)

and that should be the expected behavior for the HEAD as well.

Details

Tested the bug thing is happening at got@11.5.0 and any got@11x version.

@szmarczak
Copy link
Collaborator

I'm actually getting RequestError: Parse Error: Expected HTTP/ and if I open the URL it says 404.

@szmarczak szmarczak reopened this Jul 14, 2020
@szmarczak
Copy link
Collaborator

ah you mean actually that error

@szmarczak szmarczak added the external The issue related to an external project label Jul 14, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
external The issue related to an external project
Projects
None yet
Development

No branches or pull requests

2 participants