File tree Expand file tree Collapse file tree 1 file changed +3
-2
lines changed Expand file tree Collapse file tree 1 file changed +3
-2
lines changed Original file line number Diff line number Diff line change @@ -134,7 +134,7 @@ import { Elysia } from 'elysia'
134
134
import { isHtml } from ' @elysiajs/html'
135
135
136
136
const html = new Elysia ()
137
- .onAfterhandle (({ set }) => {
137
+ .onAfterhandle (({ set , response }) => {
138
138
if (isHtml (response ))
139
139
set .headers [' Content-Type' ] = ' text/html; charset=utf8'
140
140
})
@@ -163,9 +163,10 @@ We can accomplish that by adding `scoped: true` to the Elysia instance.
163
163
164
164
` ` ` typescript
165
165
import { Elysia } from ' elysia'
166
+ import { isHtml } from ' @elysiajs/html'
166
167
167
168
const html = new Elysia ({ scoped: true }) // [!code ++]
168
- .onAfterHandle (() => {
169
+ .onAfterHandle (({ set , response } ) => {
169
170
if (isHtml (response ))
170
171
set .headers [' Content-Type' ] = ' text/html; charset=utf8'
171
172
})
You can’t perform that action at this time.
0 commit comments