[MGNLGS-119] ContentType of XML-Sitemap wrong (Regression) Created: 25/Apr/16  Updated: 09/Feb/17  Resolved: 11/Aug/16

Status: Closed
Project: Google Sitemap (closed)
Component/s: None
Affects Version/s: 2.3.3
Fix Version/s: 2.3.4, 2.4

Type: Bug Priority: Major
Reporter: Vivian Steller Assignee: Cedric Reichenbach
Resolution: Fixed Votes: 0
Labels: support
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Attachments: PNG File Google-Sitemap-Content-Type-HTML.png    
Issue Links:
causality
caused by MAGNOLIA-6452 Add contentType field to renderers Closed
is causing MGNLGS-122 Sitemap XML validation fails against ... Closed
duplicate
duplicates MGNLGS-117 Sitemap Rendering : No valid XML Format Closed
supersession
supersedes MGNLGS-113 ContentType of XML-Sitemap is text/html Closed
Template:
Acceptance criteria:
Empty
Date of First Response:
Sprint: Basel 56
Story Points: 3

 Description   

Hi,
Updating to 5.4.5 and Google-Sitemap 2.3.3 we're experiencing missing ContentType on Google XML Sitemap requests again.
I think this is related to the Content-Type-Handling changes implemented recently (causing lot's of troubles btw.), see the linked epic.

This has been previously reported with MGNLGS-113 and has been closed as duplicate, although I can't figure out why..

Anyway, this time the issue is reproducible on demo author, see screenshot or:
1. on demo author: create a google sitemap "travel"
2. access the sitemap using https://demoauthor.magnolia-cms.com/sitemaps/travel.xml

The response content type is text/html whereas it should be text/xml or application/xml. It might be that Magnolia itself doesn't set the content type at all but the Apache HTTPd in front does so (this is the case with our and probably your demo installation).

This bug is probably a regression bug introduced with MAGNOLIA-6452



 Comments   
Comment by Mercedes Iruela [ 27/May/16 ]

Hi Vivian,

Thanks for reporting this bug.

There is a possible workaround to solve the issue, MAGNOLIA-6452 - Add contentType field to renderers include the possibility to set contentType on your render definition (/modules/rendering/renderers), what you can do is extends freemarker render and create a new one for xml, change the property name and add a property contentType: application/xml. After that, you will be able to use your xml render as renderType in sitemap template definition (/modules/google-sitemap/templates/pages/siteMapsConfiguration) instead of freemarker

Regards,

Mercedes

Comment by Jan Haderka [ 30/May/16 ]

Actually all you need to do is set property in the definition:
https://git.magnolia-cms.com/projects/MODULES/repos/google-sitemap/browse/src/main/java/info/magnolia/module/googlesitemap/model/SiteMapModel.java#83

Tho component provided by GS should indeed set that out of the box.

Generated at Mon Feb 12 02:06:36 CET 2024 using Jira 9.4.2#940002-sha1:46d1a51de284217efdcb32434eab47a99af2938b.