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:
parent
f1ec415be0
commit
9ff92ebdbc
@ -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')
|
||||
|
@ -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)
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user