Skip to content

Commit

Permalink
crash if trying to set path to / (#5003)
Browse files Browse the repository at this point in the history
* crash if trying to set path to /

fixes #4271

* Update packages/@uppy/companion/src/config/companion.js
  • Loading branch information
mifi authored Mar 19, 2024
1 parent 48f4f34 commit 4f2abc5
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion packages/@uppy/companion/src/config/companion.js
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,13 @@ const validateConfig = (companionOptions) => {
)
}

const { providerOptions, periodicPingUrls } = companionOptions
const { providerOptions, periodicPingUrls, server } = companionOptions

if (server && server.path) {
// see https://github.com/transloadit/uppy/issues/4271
// todo fix the code so we can allow `/`
if (server.path === '/') throw new Error('server.path cannot be set to /')
}

if (providerOptions) {
const deprecatedOptions = { microsoft: 'providerOptions.onedrive', google: 'providerOptions.drive', s3: 's3' }
Expand Down

0 comments on commit 4f2abc5

Please sign in to comment.