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

Should not throw exception about invalid header #162

Closed
youginil opened this issue May 8, 2023 · 5 comments · Fixed by #184
Closed

Should not throw exception about invalid header #162

youginil opened this issue May 8, 2023 · 5 comments · Fixed by #184

Comments

@youginil
Copy link

youginil commented May 8, 2023

for (const header of headerParts) {
if (!header) continue;
const firstColon = header.indexOf(':');
if (firstColon === -1) {
throw new Error(`Invalid header: "${header}"`);
}

The exception cannot be caught, and it affects user program, I think ignoring it is a decent solution.

@TooTallNate
Copy link
Owner

Looks like Node's built-in HTTP server will just silently drop those requests. I suppose we should do the same here.

@youginil youginil closed this as completed May 9, 2023
@realbillwong
Copy link

for (const header of headerParts) {
if (!header) continue;
const firstColon = header.indexOf(':');
if (firstColon === -1) {
throw new Error(`Invalid header: "${header}"`);
}

The exception cannot be caught, and it affects user program, I think ignoring it is a decent solution.

Hey, have you been able to find a way to catch the error?

@youginil
Copy link
Author

@realbillwong No

@youginil
Copy link
Author

@realbillwong Maybe this will helps you.
nodejs/node#27711 (comment)

@TooTallNate
Copy link
Owner

Should be fixed in https-proxy-agent@6.2.1.

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

Successfully merging a pull request may close this issue.

3 participants