Closed smigles closed 1 year ago
4.2.0
7.1.2
16.13.0
Linux
Ubuntu 20.04
Currently, you cannot set a custom Content-Type header if you use Nunjucks template engine. text/html; charset=utf-8 is always sent.
Content-Type
text/html; charset=utf-8
It is similar to #9
reply.type('application/xml'); return reply.view('template.njk', { data });
Content-Type response header is application/xml; charset=utf-8.
application/xml; charset=utf-8
Thanks for reporting! Would you like to send a Pull Request to address this issue? Remember to add unit tests.
Prerequisites
Fastify version
4.2.0
Plugin version
7.1.2
Node.js version
16.13.0
Operating system
Linux
Operating system version (i.e. 20.04, 11.3, 10)
Ubuntu 20.04
Description
Currently, you cannot set a custom
Content-Type
header if you use Nunjucks template engine.text/html; charset=utf-8
is always sent.It is similar to #9
Steps to Reproduce
Content-Type
response header istext/html; charset=utf-8
.Expected Behavior
Content-Type
response header isapplication/xml; charset=utf-8
.