Setting a custom Content-Type in next.config.js
Unanswered
Polar bear posted this in #help-forum
Polar bearOP
In the linked commit, I'm setting two headers on requests to the site root, and it's at least partially working since
https://github.com/toraora/custom-headers-nextjs/commit/06ddd1ef8c95c3fe4cb2dee4ae74f0e85c92f92e
It's documented that this configuration should not be used for
X-Content-Type-Options
does appear but Content-Type
is being overridden somewhere back to text/html
.https://github.com/toraora/custom-headers-nextjs/commit/06ddd1ef8c95c3fe4cb2dee4ae74f0e85c92f92e
It's documented that this configuration should not be used for
Cache-Control
, but is there a similar stipulation against using it for Content-Type
?1 Reply
Polar bearOP
for what it's worth, this does appear to work in v12.0.10
https://github.com/toraora/custom-headers-nextjs/commit/e8d1780c54e29fb4a32dd3995cb3e1bc9547178d
https://github.com/toraora/custom-headers-nextjs/commit/e8d1780c54e29fb4a32dd3995cb3e1bc9547178d