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(core): conversion between tough cookies and browser pool cookies #2443

Conversation

silva95gustavo
Copy link
Contributor

Fixes the conversion from tough cookies to browser pool cookies and vice versa, by correctly handling cookies where the domain has a leading dot versus when it doesn't.

This commit specifically fixes the conversion from tough cookies to browser pool cookies and vice versa, by correctly handling cookies where the domain has a leading dot versus when it doesn't.
@silva95gustavo silva95gustavo force-pushed the fix-convert-tough-cookie-browser-pool-cookie branch from 8d8794e to 2f19494 Compare May 4, 2024 11:57
Copy link
Contributor

@barjin barjin left a comment

Choose a reason for hiding this comment

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

Other than the nit above, good job (and nice catch!)

Cheers!

expect(session.getCookieString('https://example.com')).toBe('cookie2=your-cookie');
});

test('getCookies should work', () => {
Copy link
Contributor

Choose a reason for hiding this comment

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

Can we maybe rename this test to something more fitting?

Suggested change
test('getCookies should work', () => {
test('getCookies transforms hostOnly domains correctly', () => {

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@barjin this test is actually not testing hostOnly domains, instead it uses a domain that does not have this property enabled. The hostOnly-specific test comes right after. What do you say?

@B4nan B4nan merged commit 74f73ab into apify:master May 15, 2024
9 checks passed
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.

None yet

3 participants