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: regression in resolving the base url for enqueue link filtering #1422

Merged

Conversation

vladfrangu
Copy link
Member

No description provided.

@vladfrangu vladfrangu requested a review from B4nan July 26, 2022 15:50
@B4nan B4nan merged commit 8a00cf6 into master Jul 26, 2022
@B4nan B4nan deleted the fix/regression-in-resolve-base-url-for-enqueue-link-filtering branch July 26, 2022 16:04
Comment on lines +300 to +309
if (enqueueStrategy === EnqueueStrategy.SameDomain) {
const originalHostname = getDomain(originalUrlOrigin, { mixedInputs: false })!;
const finalHostname = getDomain(finalUrlOrigin, { mixedInputs: false })!;

if (originalHostname === finalHostname) {
return finalUrlOrigin;
}

return undefined;
}
Copy link
Member

Choose a reason for hiding this comment

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

Not sure if this is a problem or not, so just leaving it here for consideration. In the Crawlee tutorials which i'm now rewriting, I saw an origin comparison used instead of hostname. The thing is, origin includes the protocol and the hostname does not. This means that URLs with the same hostname, but different protocol (eg http vs https), would be filtered out.

Please check or confirm that it behaves correctly in Crawlee and it was just wrong in the example code.

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