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

HTTPRequest is checking for chrome-only error message "Invalid header" #12412

Open
juliandescottes opened this issue May 7, 2024 · 2 comments

Comments

@juliandescottes
Copy link
Contributor

Puppeteer expects that errors about headers will contain the message "Invalid header", both in the implementation and in tests:

export function handleError(error: ProtocolError): void {
if (error.originalMessage.includes('Invalid header')) {
throw error;
}
// In certain cases, protocol will return error if the request was
// already canceled or the page was closed. We should tolerate these
// errors.
debugError(error);
}

expect(error.message).toMatch(/Invalid header/);

We should find another way to handle this in a cross browser manner. Maybe we should settle on a dedicated error on the bidi side if that's helpful (see w3c/webdriver-bidi#707)

@OrKoN
Copy link
Collaborator

OrKoN commented May 7, 2024

@juliandescottes is there a current message that Firefox produces that we could use short-term?

@juliandescottes
Copy link
Contributor Author

@OrKoN I am currently implementing the support for the headers argument, but this hasn't landed yet. I don't know yet if we will wait for w3c/webdriver-bidi#707 or if we will use something else in the meantime. I will let you know once it's available (I will probably send a PR here as well)

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

No branches or pull requests

2 participants