Showing posts with label spring. Show all posts
Showing posts with label spring. Show all posts

Wednesday, August 17, 2022

Spring Boot : how to fix Unsupported file format in sitemap creation

  

If you ever faced this issue in the dynamic sitemap generated?

The error says Incorrect http header content-type: "application/json;charset=UTF-8" (expected: "application/xml")

This issue was caused by not setting the header content type properly. By default HTML page will return the text/html content type. 

In my case it was 


you can verify this network tab in chrome and firefox,