|
@@ -48,6 +48,7 @@ function getFileNameFromUrl (url) {
|
|
|
const { pathname } = new URL(url)
|
|
|
return pathname.substring(pathname.lastIndexOf('/') + 1)
|
|
|
}
|
|
|
+
|
|
|
/**
|
|
|
* Url
|
|
|
*
|
|
@@ -55,6 +56,8 @@ function getFileNameFromUrl (url) {
|
|
|
export default class Url extends UIPlugin {
|
|
|
static VERSION = packageJson.version
|
|
|
|
|
|
+ static requestClientId = Url.name
|
|
|
+
|
|
|
constructor (uppy, opts) {
|
|
|
super(uppy, opts)
|
|
|
this.id = this.opts.id || 'Url'
|
|
@@ -88,6 +91,8 @@ export default class Url extends UIPlugin {
|
|
|
companionHeaders: this.opts.companionHeaders,
|
|
|
companionCookiesRule: this.opts.companionCookiesRule,
|
|
|
})
|
|
|
+
|
|
|
+ this.uppy.registerRequestClient(Url.requestClientId, this.client)
|
|
|
}
|
|
|
|
|
|
getMeta (url) {
|
|
@@ -132,11 +137,10 @@ export default class Url extends UIPlugin {
|
|
|
fileId: url,
|
|
|
url,
|
|
|
},
|
|
|
+ requestClientId: Url.requestClientId,
|
|
|
},
|
|
|
}
|
|
|
|
|
|
- Object.defineProperty(tagFile.remote, 'requestClient', { value: this.client, enumerable: false })
|
|
|
-
|
|
|
this.uppy.log('[Url] Adding remote file')
|
|
|
try {
|
|
|
return this.uppy.addFile(tagFile)
|