nuxt-feedme icon indicating copy to clipboard operation
nuxt-feedme copied to clipboard

`charset` attribute missing in `Content-Type` header

Open so1ve opened this issue 1 month ago • 2 comments

The response is missing charset attribute in Content-Type header, resulting in wrong encoding.

Image

so1ve avatar Nov 17 '25 04:11 so1ve

@so1ve sorry for later response - just missed notification.

Did you tried to use specialized hook?

// Optional import for highlight, use nuxt-feedme with version, these types must be accessible
import type { NitroFeedmeHandleOptions as _NFHO } from '../../../src/types'
import type { NitroFeedmeContentOptionsQuery as _NFCOQ, NitroFeedmeContentOptionsItem as _NFCOI } from '../../../src/types/content'

import type { NitroApp } from 'nitropack'

export default (nitroApp: NitroApp) => {
  nitroApp.hooks.hook('feedme:handle:content:after[/myFeedPath.MyFeedExt]', async ({ context: { event } }) => {
    // append working incorrectly, as I can see, use get and set

    const currentContentType = event.node.res.getHeader('content-type')
    event.node.res.setHeader('content-type', `${currentContentType}; charset=utf-8`)
  })
}

Tell me if this will works out

helltraitor avatar Nov 28 '25 22:11 helltraitor

Thanks for your reply, it's working! 👍

so1ve avatar Nov 29 '25 09:11 so1ve

@so1ve can you try 2.1.0-rc.1?

https://www.npmjs.com/package/nuxt-feedme/v/2.1.0-rc.1

Please, text me later about dx.

New release scheduled at 06-07.12.2025 Issue will be closed at 06-07.12.2025 (If you will not answer me).

P.S. See README.md from branch or npmjs.com (basically charset in common and routes settings)

helltraitor avatar Dec 01 '25 22:12 helltraitor

Sorry, didn't check inbox 🥲 2.1.0-rc.1 works perfectly, and 2.1.0 should work fine too!

so1ve avatar Dec 07 '25 19:12 so1ve