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

Fix/handle malformed cookiestring response #1540

Merged
merged 9 commits into from
Jul 27, 2022
Merged

Fix/handle malformed cookiestring response #1540

merged 9 commits into from
Jul 27, 2022

Conversation

juanig1
Copy link
Contributor

@juanig1 juanig1 commented Jul 25, 2022

See this comment

tldr: handles malformed cookies received through a response Set-Cookie header
closes ART-574

core/lib/engine_http.js Outdated Show resolved Hide resolved
@juanig1 juanig1 requested a review from hassy July 26, 2022 13:55
@hassy
Copy link
Member

hassy commented Jul 26, 2022

Is this a regression in v2.0.0-22, i.e. does it work with v2.0.0-21, or have we always had this issue?

@juanig1 juanig1 marked this pull request as ready for review July 26, 2022 16:39
try {
context._jar.setCookieSync(cookieString, url);
} catch (err) {
ee.emit('error', 'Could not parse cookieString from response header, skipping it ' + cookieString);
Copy link
Member

Choose a reason for hiding this comment

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

The messages from these error events go right into the metric report, so it's best to keep it short. How about something like cookie_parse_error_invalid_cookie?

For debugging we can log the current message with debug() instead.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done, used uppercase for the error message for consistency.
One detail is that we can get N error messages for one call (as there may be N invalid Set-Cookie headers)

@juanig1 juanig1 requested a review from hassy July 27, 2022 12:27
@hassy hassy merged commit db4f8ce into artilleryio:master Jul 27, 2022
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.

2 participants