OGC API collections HTML response not returning content type header when Features Templating HTML template

Hi Geoserver users,

Is there a trick for getting HTML templates built using the features templating extension to display correctly for OCG Feature collections returned as HTML? I’m getting plain text raw html back.

It looks like geoserver is not sending Content-Type in the response headers when a features templating template exists. Please see attached image, left is a layer with no FT template, right has a template set up.

The template works/displays correctly for regular GetFeature request.

Thanks in advance!
Ursula

Hi,
while I cannot be sure, I think it’s due to HTMLTemplateResponse not overriding the getMimeType method, e.g., compare these two classes, one for GML, one for HTML:

To get a fix see this guide.

Cheers
Andrea

1 Like

Hi @aaime-geosolutions,
Thanks for taking a look and confirming the bug. We’re going to look into CS to get this resolved.
Cheers,
Ursula