We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 37729f9 commit 169180eCopy full SHA for 169180e
src/index.ts
@@ -171,8 +171,7 @@ async function createUploadRequest(
171
headers: {
172
...options?.headers,
173
'Content-Type': `multipart/form-data; boundary=${boundary}`
174
- },
175
- signal: options.signal
+ }
176
})
177
let aborted = false
178
req.on('error', _err => {
@@ -204,11 +203,12 @@ async function createUploadRequest(
204
203
)
205
}
206
207
- } catch (err) {
208
- req.destroy(err as Error)
209
- throw err
+ } catch (e) {
+ req.destroy(e as Error)
+ throw e
210
} finally {
211
if (!aborted) {
+ // Close request after writing all data.
212
req.end()
213
214
0 commit comments