-
Notifications
You must be signed in to change notification settings - Fork 2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Send version header #1564
Send version header #1564
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thanks for fast turnaround! one comment + the stuff on slack
const allowedClients = req.uppy.options.clients | ||
// if no preset clients then allow any client | ||
if (!allowedClients || hasMatch(origin, allowedClients) || hasMatch(parseUrl(origin).host, allowedClients)) { | ||
return res.send(htmlContent(uppyAuthToken, origin)) | ||
return res.send(clientVersion ? htmlContent(uppyAuthToken, origin) : oldHtmlContent(uppyAuthToken, origin)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This works but we should add a todo to the changelog to use https://www.npmjs.com/package/semver for these checks, especially if we're going to have more breaking changes.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
adding on asana so you can ignore the above
e; nvm you already did it, both is fine :P
Yeah, +100 thanks for fast turnaround! |
@@ -63,7 +63,7 @@ module.exports.app = (options = {}) => { | |||
app.use((req, res, next) => { | |||
res.header( | |||
'Access-Control-Allow-Headers', | |||
[res.get('Access-Control-Allow-Headers'), 'uppy-auth-token'].join(', ') | |||
[res.get('Access-Control-Allow-Headers'), 'uppy-auth-token', 'uppy-client'].join(', ') | |||
) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
uppy-versions?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Uppy-Versions
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Node.js will lowercase it for us, but i think so far we've tried to use uppercasing like that in tus/uppy headers
We’ve accidentally introduced breaking changes in
@uppy/companion@1.0.1
in 156e86e#diff-7b39a69472a3e796126259ddff14f820R45.This fix restores backwards-compatibility with Uppy Client
^1.0.0
, by introducinguppyVersions
param (in the future also anuppy-versions
header). If this param is present, the authentication token is sent in a new way, as a string, otherwise it’s sent the old way, as JSON object (incompatible with IE).You should use
@uppy/companion@1.0.2
for backwards-compatibility,@uppy/companion@1.0.1
is deprecated.