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: remove path containing accessible urls #575

Merged
merged 3 commits into from
Jan 10, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion src/sitemap/handler.js
Original file line number Diff line number Diff line change
Expand Up @@ -355,7 +355,6 @@ export async function findSitemap(inputUrl) {
return {
success: true,
reasons: [{ value: 'Sitemaps found and checked.' }],
paths: extractedPaths,
url: inputUrl,
details: { issues: notOkPagesFromSitemap },
};
Expand Down
25 changes: 0 additions & 25 deletions test/audits/sitemap.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -121,10 +121,6 @@ describe('Sitemap Audit', () => {
issues: {},
},
success: true,
paths: {
[`${url}/sitemap_foo.xml`]: [`${url}/foo`, `${url}/bar`],
[`${url}/sitemap_bar.xml`]: [`${url}/baz`, `${url}/cux`],
},
reasons: [{
value: 'Sitemaps found and checked.',
}],
Expand Down Expand Up @@ -175,10 +171,6 @@ describe('Sitemap Audit', () => {
issues: {},
},
success: true,
paths: {
[`${url}/sitemap_foo.xml`]: [`${url}/foo`, `${url}/bar`],
[`${url}/sitemap_bar.xml`]: [`${url}/baz`, `${url}/cux`],
},
reasons: [{
value: 'Sitemaps found and checked.',
}],
Expand Down Expand Up @@ -225,10 +217,6 @@ describe('Sitemap Audit', () => {
issues: {},
},
success: true,
paths: {
[`${url}/sitemap_foo.txt`]: [`${url}/foo`, `${url}/bar`],
[`${url}/sitemap_bar.txt`]: [`${url}/baz`, `${url}/cux`],
},
reasons: [{
value: 'Sitemaps found and checked.',
}],
Expand Down Expand Up @@ -531,9 +519,6 @@ describe('Sitemap Audit', () => {

const result = await findSitemap(url);
expect(result.success).to.equal(true);
expect(result.paths).to.deep.equal({
[`${url}/sitemap.xml`]: [`${url}/foo`, `${url}/bar`],
});
});

it('should fail when sitemap contents have a different URL than the base domain (regardless of www. or not)', async () => {
Expand Down Expand Up @@ -617,9 +602,6 @@ describe('Sitemap Audit', () => {
info: () => {},
});
expect(result.success).to.equal(true);
expect(result.paths).to.deep.equal({
[`${url}/sitemap.xml`]: [`${url}/foo`, `${url}/bar`],
});
});

it('should return success when sitemap_index.xml is found', async () => {
Expand Down Expand Up @@ -665,10 +647,6 @@ describe('Sitemap Audit', () => {

const result = await findSitemap(url);
expect(result.success).to.equal(true);
expect(result.paths).to.deep.equal({
[`${url}/sitemap_foo.xml`]: [`${url}/foo`, `${url}/bar`],
[`${url}/sitemap_bar.xml`]: [`${url}/baz`, `${url}/cux`],
});
});

it('should return success when sitemap paths have www', async () => {
Expand All @@ -690,9 +668,6 @@ describe('Sitemap Audit', () => {

const result = await findSitemap(`${protocol}://www.${domain}`);
expect(result.success).to.equal(true);
expect(result.paths).to.deep.equal({
[`${url}/sitemap.xml`]: [`${protocol}://www.${domain}/foo`, `${protocol}://www.${domain}/bar`],
});
});

it('should return error when no sitemap is found', async () => {
Expand Down
Loading