Skip to content
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

Default allow headers #3167

Merged
merged 6 commits into from Sep 30, 2021
Merged

Default allow headers #3167

merged 6 commits into from Sep 30, 2021

Conversation

mifi
Copy link
Contributor

@mifi mifi commented Sep 3, 2021

Add the following headers to access-control-allow-headers by default:

  • Authorization
  • Origin
  • Content-Type
  • Accept
    I believe they are always needed for basic operation of companion, and if the developers forget to add them I believe they will get cryptic errors. See aws-s3-multipsart upload issue #3021

Let me know if anyone knows any reason why these headers cannot be default added.

Also:

  • Remove custom middlewares setHeader in examples and standalone
  • Update outdated readme for S3: AWS now requires JSON instead of XML format
  • refactor cors middleware to avoid duplicates

If this PR can not be merged, we need to update all example code to include the custom setHeader middleware.

Add the following headers to access-control-allow-headers by default:
Authorization, Origin, Content-Type, Accept
They are needed for basic operation. See #3021
therefore also remove custom middlewares in examples and standalone
AWS now requires JSON instead of XML format
@mifi mifi added Companion The auth server (for Instagram, GDrive, etc) and upload proxy (for S3) Improvement labels Sep 3, 2021
packages/@uppy/companion/src/server/middlewares.js Outdated Show resolved Hide resolved
packages/@uppy/companion/src/server/middlewares.js Outdated Show resolved Hide resolved
packages/@uppy/companion/src/server/middlewares.js Outdated Show resolved Hide resolved
packages/@uppy/companion/src/server/middlewares.js Outdated Show resolved Hide resolved
packages/@uppy/companion/src/server/middlewares.js Outdated Show resolved Hide resolved
packages/@uppy/companion/src/server/middlewares.js Outdated Show resolved Hide resolved
mifi and others added 3 commits September 4, 2021 10:46
Co-authored-by: Antoine du Hamel <duhamelantoine1995@gmail.com>
Co-authored-by: Antoine du Hamel <duhamelantoine1995@gmail.com>
@Murderlon Murderlon linked an issue Sep 8, 2021 that may be closed by this pull request
@mifi mifi merged commit 12705e7 into main Sep 30, 2021
@mifi mifi deleted the default-allow-headers branch September 30, 2021 09:37
HeavenFox pushed a commit to docsend/uppy that referenced this pull request Jun 27, 2023
* refactor cors middleware to avoid duplicates

* Make more ACAH headers default

Add the following headers to access-control-allow-headers by default:
Authorization, Origin, Content-Type, Accept
They are needed for basic operation. See transloadit#3021
therefore also remove custom middlewares in examples and standalone

* Update outdated readme for S3

AWS now requires JSON instead of XML format

* Update packages/@uppy/companion/src/server/middlewares.js

Co-authored-by: Antoine du Hamel <duhamelantoine1995@gmail.com>

* Update packages/@uppy/companion/src/server/middlewares.js

Co-authored-by: Antoine du Hamel <duhamelantoine1995@gmail.com>

* fix review comments

Co-authored-by: Antoine du Hamel <duhamelantoine1995@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Companion The auth server (for Instagram, GDrive, etc) and upload proxy (for S3) Improvement
Projects
None yet
Development

Successfully merging this pull request may close these issues.

aws-s3-multipsart upload issue
3 participants