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

bug: sitemap parser returning invalid URLs #2698

Closed
barjin opened this issue Oct 8, 2024 · 1 comment · Fixed by #2709
Closed

bug: sitemap parser returning invalid URLs #2698

barjin opened this issue Oct 8, 2024 · 1 comment · Fixed by #2709
Assignees
Labels
bug Something isn't working. hacktoberfest t-tooling Issues with this label are in the ownership of the tooling team.

Comments

@barjin
Copy link
Contributor

barjin commented Oct 8, 2024

In the case of a pretty-printed XML sitemap, the Sitemap.load() call can return invalid URLs (the text content of the loc element contains newlines and whitespace characters).

obrazek

The solution is likely simple - we should call trim() on those (see snippet below). Maybe also try parsing the urls with new URL(), skipping if this call throws?

this.url.loc = text;

@barjin barjin added bug Something isn't working. hacktoberfest labels Oct 8, 2024
@github-actions github-actions bot added the t-tooling Issues with this label are in the ownership of the tooling team. label Oct 8, 2024
@AryanGupta001
Copy link
Contributor

hi! , I am starting my open source journey and would like to work on this issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working. hacktoberfest t-tooling Issues with this label are in the ownership of the tooling team.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants