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 1914061 - Sitemap urls are using GCP storage links which are being rejected by Google search indexer since it is not a property we own #2305

Merged
merged 2 commits into from
Sep 3, 2024
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
9 changes: 6 additions & 3 deletions extensions/SiteMapIndex/Extension.pm
Original file line number Diff line number Diff line change
Expand Up @@ -53,10 +53,13 @@ sub before_robots_txt {

return if !Bugzilla->params->{sitemapindex_enabled};

# We use urlbase instead of storage.googleapis.com since we have
# a rewrite rule in the nginx config to redirect for us. This is
# because the sitemap specification requires the sitemap hosts to
# be ones we own locally and not external sites.
my $sitemap_url
= 'https://'
. Bugzilla->params->{sitemapindex_google_host}
. '/storage/v1/b/'
= Bugzilla->localconfig->urlbase
. 'sitemap/storage/v1/b/'
. Bugzilla->params->{sitemapindex_google_bucket} . '/o/'
. 'sitemap_index.xml?alt=media';

Expand Down
8 changes: 6 additions & 2 deletions extensions/SiteMapIndex/lib/Util.pm
Original file line number Diff line number Diff line change
Expand Up @@ -123,9 +123,13 @@ sub _generate_sitemap_index {
<sitemapindex xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
END

# We use urlbase instead of storage.googleapis.com since we have
# a rewrite rule in the nginx config to redirect for us. This is
# because the sitemap specification requires the sitemap hosts to
# be ones we own locally and not external sites.
my $sitemap_url
= 'https://'
. Bugzilla->params->{sitemapindex_google_host} . '/storage/v1/b/'
= Bugzilla->localconfig->urlbase
. 'sitemap/storage/v1/b/'
. Bugzilla->params->{sitemapindex_google_bucket} . '/o';

foreach my $filename (@$filelist) {
Expand Down
Loading