Skip to content

Commit c3a2465

Browse files
authored
🔧 fix: some missing properties in examples (#229)
1 parent 38ab866 commit c3a2465

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

‎docs/essential/scope.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,7 @@ import { Elysia } from 'elysia'
134134
import { isHtml } from '@elysiajs/html'
135135

136136
const html = new Elysia()
137-
.onAfterhandle(({ set }) => {
137+
.onAfterhandle(({ set, response }) => {
138138
if (isHtml(response))
139139
set.headers['Content-Type'] = 'text/html; charset=utf8'
140140
})
@@ -163,9 +163,10 @@ We can accomplish that by adding `scoped: true` to the Elysia instance.
163163
164164
```typescript
165165
import { Elysia } from 'elysia'
166+
import { isHtml } from '@elysiajs/html'
166167

167168
const html = new Elysia({ scoped: true }) // [!code ++]
168-
.onAfterHandle(() => {
169+
.onAfterHandle(({ set, response }) => {
169170
if (isHtml(response))
170171
set.headers['Content-Type'] = 'text/html; charset=utf8'
171172
})

0 commit comments

Comments
 (0)