|
@@ -59,38 +59,38 @@ const Dropbox = require('@uppy/dropbox')
|
|
|
const Transloadit = require('@uppy/transloadit')
|
|
|
|
|
|
uppy.use(Dropbox, {
|
|
|
- serverUrl: Transloadit.COMPANION
|
|
|
- serverPattern: Transloadit.COMPANION_PATTERN
|
|
|
+ companionUrl: Transloadit.COMPANION
|
|
|
+ companionAllowedHosts: Transloadit.COMPANION_PATTERN
|
|
|
})
|
|
|
```
|
|
|
|
|
|
-When using `Transloadit.COMPANION`, you should also configure [`serverPattern: Transloadit.COMPANION_PATTERN`](#Transloadit-COMPANION-PATTERN).
|
|
|
+When using `Transloadit.COMPANION`, you should also configure [`companionAllowedHosts: Transloadit.COMPANION_PATTERN`](#Transloadit-COMPANION-PATTERN).
|
|
|
|
|
|
The value of this constant is `https://api2.transloadit.com/companion`. If you are using a custom [`service`](#service) option, you should also set a custom host option in your provider plugins, by taking a Transloadit API url and appending `/companion`:
|
|
|
|
|
|
```js
|
|
|
uppy.use(Dropbox, {
|
|
|
- serverUrl: 'https://api2-us-east-1.transloadit.com/companion'
|
|
|
+ companionUrl: 'https://api2-us-east-1.transloadit.com/companion'
|
|
|
})
|
|
|
```
|
|
|
|
|
|
### `Transloadit.COMPANION_PATTERN`
|
|
|
|
|
|
-A RegExp pattern matching Transloadit's hosted companion endpoints. The pattern is used in remote provider `serverPattern` options, to ensure that third party authentication messages cannot be faked by an attacker's page, but can only originate from Transloadit's servers.
|
|
|
+A RegExp pattern matching Transloadit's hosted companion endpoints. The pattern is used in remote provider `companionAllowedHosts` options, to ensure that third party authentication messages cannot be faked by an attacker's page, but can only originate from Transloadit's servers.
|
|
|
|
|
|
-Use it whenever you use `serverUrl: Transloadit.COMPANION`, like so:
|
|
|
+Use it whenever you use `companionUrl: Transloadit.COMPANION`, like so:
|
|
|
|
|
|
```js
|
|
|
const Dropbox = require('@uppy/dropbox')
|
|
|
const Transloadit = require('@uppy/transloadit')
|
|
|
|
|
|
uppy.use(Dropbox, {
|
|
|
- serverUrl: Transloadit.COMPANION
|
|
|
- serverPattern: Transloadit.COMPANION_PATTERN
|
|
|
+ companionUrl: Transloadit.COMPANION
|
|
|
+ companionAllowedHosts: Transloadit.COMPANION_PATTERN
|
|
|
})
|
|
|
```
|
|
|
|
|
|
-The value of this constant covers _all_ Transloadit's Companion servers, so it does not need to be changed if you are using a custom [`service`](#service) option. However, if you are not using the Transloadit Companion servers at `*.transloadit.com`, make sure to set the `serverPattern` option to something that matches what you do use.
|
|
|
+The value of this constant covers _all_ Transloadit's Companion servers, so it does not need to be changed if you are using a custom [`service`](#service) option. However, if you are not using the Transloadit Companion servers at `*.transloadit.com`, make sure to set the `companionAllowedHosts` option to something that matches what you do use.
|
|
|
|
|
|
## Options
|
|
|
|