Skip to content

fix: parse statusText from the extraInfo event#7798

Merged
OrKoN merged 1 commit into
mainfrom
HTTPResponse-extraInfo-statusText
Nov 26, 2021
Merged

fix: parse statusText from the extraInfo event#7798
OrKoN merged 1 commit into
mainfrom
HTTPResponse-extraInfo-statusText

Conversation

@OrKoN

@OrKoN OrKoN commented Nov 25, 2021

Copy link
Copy Markdown
Collaborator

Issues: #7458

@google-cla google-cla Bot added the cla: yes label Nov 25, 2021
@OrKoN OrKoN requested a review from josepharhar November 25, 2021 20:27
@OrKoN

OrKoN commented Nov 25, 2021

Copy link
Copy Markdown
Collaborator Author

@josepharhar PTAL (extracted your change from #7640)

@josepharhar

Copy link
Copy Markdown
Contributor

Does this include the test I added with empty status text?

@OrKoN

OrKoN commented Nov 25, 2021

Copy link
Copy Markdown
Collaborator Author

Overlooked it: I am gonna add it in a moment.

@OrKoN OrKoN force-pushed the HTTPResponse-extraInfo-statusText branch from 0394fb0 to 6ad0b24 Compare November 25, 2021 20:56
@OrKoN OrKoN force-pushed the HTTPResponse-extraInfo-statusText branch from 6ad0b24 to 3823a21 Compare November 25, 2021 21:06
@OrKoN OrKoN requested a review from sadym-chromium November 25, 2021 21:25
@OrKoN OrKoN enabled auto-merge (squash) November 26, 2021 07:03
Comment on lines +105 to +107
const firstLine = extraInfo.headersText.split('\r', 1)[0];
if (!firstLine) return;
const match = firstLine.match(/[^ ]* [^ ]* (.*)/);

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It would be great to have unit testы on this parsing.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yeah, the reason is that Puppeteer does not have unit tests. The tests that are called "unit" are added with this PR (one existing test and one empty status text test).

@sadym-chromium

Copy link
Copy Markdown
Collaborator

It would be really great to have the parsing unit-tested. If you have some strong reasons not to do it, please clarify them and go ahead with merging.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants