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

Removal of leading WWWnnn. in URL canonicalization is too aggressive #29

Open
tfmorris opened this issue Aug 28, 2023 · 1 comment · May be fixed by #30
Open

Removal of leading WWWnnn. in URL canonicalization is too aggressive #29

tfmorris opened this issue Aug 28, 2023 · 1 comment · May be fixed by #30

Comments

@tfmorris
Copy link

This bug (internetarchive/surt#28) reported against the Python SURT module applies to the URL canonicalization here as well.

The following URLs are incorrectly canonicalized with SURT as "com)/".

SURT = "com)/"
1. https://www1355544.com/
2. https://www3288.com/
3. https://www504778.com/
4. https://www556798.com/
5. https://www57912.com/

There's also a difference in the handling of these prefixes between the two packages: the Java package removes ALL leading matching prefixes while the Python package only removes the first one. I think the less aggressive approach of the Python package might be preferable.

tfmorris added a commit to tfmorris/ia-web-commons that referenced this issue Aug 28, 2023
Requires at least two dots (.) in domain name before removing
leading www\d*
@tfmorris tfmorris linked a pull request Aug 28, 2023 that will close this issue
@sebastian-nagel
Copy link

Thanks, @tfmorris! I definitely agree! But should fix the Python surt module at about the same time to keep indexing and lookup compatible.

$> pip3 show surt
Name: surt
Version: 0.3.1
Summary: Sort-friendly URI Reordering Transform (SURT) python package.
...

$> python3
Python 3.12.3 (main, Nov  6 2024, 18:32:19) [GCC 13.2.0] on linux
...
>>> from surt import surt
>>> surt("https://www1355544.com/")
'com)/'

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 a pull request may close this issue.

2 participants