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

Use CANONICAL_URL for sitemap route #690

Merged
merged 1 commit into from
Jun 18, 2020

Conversation

janus-reith
Copy link
Collaborator

Signed-off-by: Janus Reith mail@janusreith.de

Resolves #689
Impact: minor
Type: bugfix

Issue

Sitemap routes currently show undefined:// as req.protocol is not available in api routes.

Solution

As detailed in #689, this will use CANONICAL_URL and pass it to the sitemap query instead of parsing the url from the incoming request.

Breaking changes

None - I consider it unlikely that shops request sitemaps from a host name that differs from the one defined in CANONICAL_URL. If that is the case, these could adjust their sitemap api route individually.

Testing

  1. Make sure your api provides a sitemap
  2. Navigate to http://localhost:4000/sitemap.xml and make sure it returns proper urls in the loc field.

Signed-off-by: Janus Reith <mail@janusreith.de>
@willopez willopez self-requested a review June 18, 2020 19:23
Copy link
Member

@willopez willopez left a comment

Choose a reason for hiding this comment

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

LGTM, thanks

@willopez willopez merged commit a724850 into reactioncommerce:trunk Jun 18, 2020
@kieckhafer kieckhafer mentioned this pull request Sep 25, 2020
@ghost
Copy link

ghost commented Oct 3, 2020

Could this be backported and patched onto 3.1.0 since the 4.0 release may be a ways out?

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.

Sitemap Handler produces urls with undefined protocol
2 participants