0
0
mirror of https://github.com/honojs/hono.git synced 2024-11-24 02:07:30 +01:00

feat(streaming): add Identity as Content-Encoding for streamText()

This commit is contained in:
Yusuke Wada 2024-10-01 14:30:29 +09:00
parent f1ec415be0
commit 9ff92ebdbc
2 changed files with 2 additions and 0 deletions

View File

@ -20,6 +20,7 @@ describe('Text Streaming Helper', () => {
expect(res.headers.get('content-type')).toMatch(/^text\/plain/)
expect(res.headers.get('x-content-type-options')).toBe('nosniff')
expect(res.headers.get('transfer-encoding')).toBe('chunked')
expect(res.headers.get('content-encoding')).toBe('identity')
if (!res.body) {
throw new Error('Body is null')

View File

@ -11,5 +11,6 @@ export const streamText = (
c.header('Content-Type', TEXT_PLAIN)
c.header('X-Content-Type-Options', 'nosniff')
c.header('Transfer-Encoding', 'chunked')
c.header('Content-Encoding', 'identity')
return stream(c, cb, onError)
}