mirror of
https://github.com/transloadit/uppy.git
synced 2026-01-23 02:25:07 +00:00
parent
efda84cc23
commit
54a46db340
2 changed files with 8 additions and 1 deletions
5
.changeset/dry-readers-itch.md
Normal file
5
.changeset/dry-readers-itch.md
Normal file
|
|
@ -0,0 +1,5 @@
|
||||||
|
---
|
||||||
|
"@uppy/tus": patch
|
||||||
|
---
|
||||||
|
|
||||||
|
Fix Node.js support by conditionally setting a property which does not exist in Node.js instead of crashing.
|
||||||
|
|
@ -251,7 +251,9 @@ export default class Tus<M extends Meta, B extends Body> extends BasePlugin<
|
||||||
|
|
||||||
uploadOptions.onBeforeRequest = async (req) => {
|
uploadOptions.onBeforeRequest = async (req) => {
|
||||||
const xhr = req.getUnderlyingObject()
|
const xhr = req.getUnderlyingObject()
|
||||||
xhr.withCredentials = !!opts.withCredentials
|
if (xhr) {
|
||||||
|
xhr.withCredentials = !!opts.withCredentials
|
||||||
|
}
|
||||||
|
|
||||||
let userProvidedPromise: Promise<void> | void
|
let userProvidedPromise: Promise<void> | void
|
||||||
if (typeof onBeforeRequest === 'function') {
|
if (typeof onBeforeRequest === 'function') {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue