Skip to content

Commit 169180e

Browse files
committed
Minor cleanup
1 parent 37729f9 commit 169180e

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

src/index.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -171,8 +171,7 @@ async function createUploadRequest(
171171
headers: {
172172
...options?.headers,
173173
'Content-Type': `multipart/form-data; boundary=${boundary}`
174-
},
175-
signal: options.signal
174+
}
176175
})
177176
let aborted = false
178177
req.on('error', _err => {
@@ -204,11 +203,12 @@ async function createUploadRequest(
204203
)
205204
}
206205
}
207-
} catch (err) {
208-
req.destroy(err as Error)
209-
throw err
206+
} catch (e) {
207+
req.destroy(e as Error)
208+
throw e
210209
} finally {
211210
if (!aborted) {
211+
// Close request after writing all data.
212212
req.end()
213213
}
214214
}

0 commit comments

Comments
 (0)