ethercreative / seo

SEO utilities including a unique field type, sitemap & redirect manager
MIT License
269 stars 96 forks source link

Incorrect Content-type header for sitemap #334

Closed jakepm closed 3 years ago

jakepm commented 3 years ago

Description

Sitemap.xml generated by the SEO plugin does not have the correct Content-type header.

Steps to reproduce

  1. Install SEO plugin
  2. Add a section
  3. Configure sitemap to include section
  4. Run the sitemap.xml through an online validator

Additional info

alexjcollins commented 3 years ago

I can't recreate this; I've checked a bunch of our production sites and they all validate correctly with a Content-Type header of application/xml. Do you have an example you can share?

jakepm commented 3 years ago

For anybody else who has this issue and find this thread, the cause was actually our server enforcing trailing slashes on URLs. Sitemap was not excluded from this rule, so the sitemap.xml request was being redirected to sitemap.xml/ thus giving an incorrect Content-type header when validating the file.