Skip to content

Commit 5363bb0

Browse files
committed
update onResponse hook example
1 parent f26c60a commit 5363bb0

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,9 +109,9 @@ For developers reference, next we describe how the default `onResponse` hook loo
109109
```js
110110
const pump = require('pump')
111111
const toArray = require('stream-to-array')
112+
const TRANSFER_ENCODING_HEADER_NAME = 'transfer-encoding'
112113

113114
const onResponse = async (req, res, stream) => {
114-
const TRANSFER_ENCODING_HEADER_NAME = 'transfer-encoding'
115115
const chunked = stream.headers[TRANSFER_ENCODING_HEADER_NAME]
116116
? stream.headers[TRANSFER_ENCODING_HEADER_NAME].endsWith('chunked')
117117
: false

0 commit comments

Comments
 (0)