mirror of
https://github.com/honojs/hono.git
synced 2024-11-21 18:18:57 +01:00
feat(jsx-renderer): set Content-Encoding
when stream
is true
(#3355)
This commit is contained in:
parent
6f69bf04b7
commit
39600c4449
@ -238,6 +238,7 @@ describe('JSX renderer', () => {
|
||||
expect(res.status).toBe(200)
|
||||
expect(res.headers.get('Transfer-Encoding')).toEqual('chunked')
|
||||
expect(res.headers.get('Content-Type')).toEqual('text/html; charset=UTF-8')
|
||||
expect(res.headers.get('Content-Encoding')).toEqual('Identity')
|
||||
|
||||
if (!res.body) {
|
||||
throw new Error('Body is null')
|
||||
|
@ -60,6 +60,7 @@ const createRenderer =
|
||||
if (options.stream === true) {
|
||||
c.header('Transfer-Encoding', 'chunked')
|
||||
c.header('Content-Type', 'text/html; charset=UTF-8')
|
||||
c.header('Content-Encoding', 'Identity')
|
||||
} else {
|
||||
for (const [key, value] of Object.entries(options.stream)) {
|
||||
c.header(key, value)
|
||||
|
Loading…
Reference in New Issue
Block a user