Skip to content

Commit e7401c6

Browse files
committed
refactor: moved hasError closer to usage
1 parent 116092b commit e7401c6

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

index.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -143,14 +143,14 @@ function impl (req, resOrSocket, headOrNil, {
143143
function proxy (req, resOrSocket, options, onRes, onError) {
144144
const proxyReq = http.request(options)
145145

146-
let hasError = false
147-
148146
const abort = () => {
149147
if (!proxyReq.aborted) {
150148
proxyReq.abort()
151149
}
152150
}
153151

152+
let hasError = false
153+
154154
const onProxyError = err => {
155155
if (hasError) {
156156
return

0 commit comments

Comments
 (0)