Skip to content

Commit

Permalink
@uppy/companion: fix TypeError when parsing request (#5303)
Browse files Browse the repository at this point in the history
The previous version was creating the opportunity for a TypeError when
assumptions on the client request were not met.
  • Loading branch information
aduh95 authored Jul 3, 2024
1 parent 937107a commit f1ffda2
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion packages/@uppy/companion/src/server/controllers/connect.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ module.exports = function connect(req, res) {
} else if (oauthOrigin && oauthOrigin.length < 2) {
// eslint-disable-next-line prefer-destructuring
stateObj.origin = oauthOrigin[0]
} else {
} else if (req.query.state) {
// If we have multiple allowed origins, we need to check the client-supplied origin from query.
// If the client provides an untrusted origin,
// we want to send `undefined`. `undefined` means `/`, which is the same origin when passed to `postMessage`.
Expand Down

0 comments on commit f1ffda2

Please sign in to comment.