-
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
Use cors module instead of custom cors logic #2823
Conversation
- adds support for regex COMPANION_CLIENT_ORIGINS_REGEX - encapsulate custom cors header merge logic in own middleware - pull out non cors logic from middleware - unit test the cors middleware
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.
Very nice, and great that you were explicit where we needed to diverge from default cors
behavior
Co-authored-by: Julian Gruber <julian@juliangruber.com>
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.
looks great, hard to predict if it will have any breaking consequences so I guess there's one way to find out 😇
Can this break if someone is running Uppy 1.3 from 1 year ago and Companion upgrades on Transloadit servers? |
Is there anything special about uppy 1.3? I can't really guarantee that nothing will break, but I'm using the Differences in behaviour that I can think of are:
|
I think uppy 1.3 was just a random example of an old version. People might still have them if they started using the CDN packages for example and never updated the URLs. |
Yeah, I understand. I did mean 1.3 or 1.5 as an arbitrary example of old versions. What I can remember was backwards-compat breaking is this: #1564 |
Here goes! Let's keep an eye out for potential issues. Thanks, Mikael! |
* use cors module instead of custom cors logic transloadit#2762 - adds support for regex COMPANION_CLIENT_ORIGINS_REGEX - encapsulate custom cors header merge logic in own middleware - pull out non cors logic from middleware - unit test the cors middleware * fix capitalization Co-authored-by: Julian Gruber <julian@juliangruber.com> Co-authored-by: Julian Gruber <julian@juliangruber.com>
fixes #2762
corsOrigins
which equals tocors
origin configNOTE: that returned headers are probably not exactly the same as before (there were no unit tests for cors), but it will be according to the cors module, so it should be a more "standard" behaviour.