Make WordPress Core

Opened 3 years ago

Closed 2 years ago

Last modified 2 years ago

#51324 closed defect (bug) (wontfix)

sitemap.xml and sitemap-xml headers return html as content type

Reported by: superpoincare's profile superpoincare Owned by:
Milestone: Priority: normal
Severity: normal Version: 5.5
Component: Sitemaps Keywords:
Focuses: Cc:

Description

If WordPress is installed at https://www.example.com, then the addresses https://www.example.com/sitemap.xml and https://www.example.com/sitemap-xml send "text/html; charset=UTF-8" as the Content-Type header.

Of course these urls get redirected to wp-sitemap.xml which sends the correct header "application/xml; charset=UTF-8". Just wondering if the page before redirection should also.

Change History (6)

#1 @swissspidy
3 years ago

  • Component changed from General to Canonical

#2 @knutsp
3 years ago

  • Component changed from Canonical to Sitemaps
  • Type changed from enhancement to defect (bug)
  • Version changed from 5.5.1 to 5.5

Hard to see this as an enhancement in Canonical component. I's a bug in the Sitemap component, not?

#3 follow-up: @RavanH
2 years ago

  • Resolution set to invalid
  • Status changed from new to closed

This ticket is for WordPress 5.5 so this may have changed but sitemap.xml is not part of the WordPress core sitemaps. Not in 5.9 anyway... It redirects to wp-sitemap.xml

I verified the Content-Type headers for the index on wp-sitemap.xml and all sitemaps but always get application/xml; charset=UTF-8.

This issue may be no longer valid or related to a (sitemap) plugin?

#4 in reply to: ↑ 3 @SergeyBiryukov
2 years ago

  • Resolution changed from invalid to wontfix

Replying to RavanH:

This ticket is for WordPress 5.5 so this may have changed but sitemap.xml is not part of the WordPress core sitemaps. Not in 5.9 anyway... It redirects to wp-sitemap.xml

Thanks for testing! It does issue a 302 redirect, but also sends a Content-Type: text/html; charset=UTF-8 header, which is exactly what the ticket is about. This still happens in current trunk.

I verified the Content-Type headers for the index on wp-sitemap.xml and all sitemaps but always get application/xml; charset=UTF-8.

This is also mentioned in the ticket, the header is indeed correct on actual sitemaps.

Given the lack of traction in the last 18 months, it looks like this might be an acceptable edge case and is not going to be addressed at this time. Feel free to reopen if there is still interest in working on this further.

#5 @RavanH
2 years ago

@SergeyBiryukov you're right I did not read the last sentence of the ticket. The discussion would then be about whether a Content-Type header alongside a Location header makes any sense at all (there being no content sent) :)

#6 @SergeyBiryukov
2 years ago

  • Milestone Awaiting Review deleted

Forgot to remove the milestone in my previous comment; discussion can continue on a closed ticket until there is any interest in reopening it.

Note: See TracTickets for help on using tickets.