Next.js Discord

Discord Forum

Setting a custom Content-Type in next.config.js

Unanswered
Polar bear posted this in #help-forum
Open in Discord
Avatar
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 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

Avatar
Polar bearOP