Skip to content

Commit

Permalink
companion: use decodeURI only when value is set
Browse files Browse the repository at this point in the history
  • Loading branch information
ifedapoolarewaju committed Jun 20, 2019
1 parent 3d167cd commit cabff1b
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion packages/@uppy/companion/src/uppy.js
Original file line number Diff line number Diff line change
Expand Up @@ -229,11 +229,12 @@ const getOptionsMiddleware = (options) => {
* @param {function} next
*/
const middleware = (req, res, next) => {
const versionFromQuery = req.query.uppyVersions ? decodeURIComponent(req.query.uppyVersions) : null
req.uppy = {
options,
s3Client,
authToken: req.header('uppy-auth-token') || req.query.uppyAuthToken,
clientVersion: req.header('uppy-versions') || decodeURIComponent(req.query.uppyVersions) || '1.0.0',
clientVersion: req.header('uppy-versions') || versionFromQuery || '1.0.0',
buildURL: getURLBuilder(options)
}
next()
Expand Down

0 comments on commit cabff1b

Please sign in to comment.