Browse Source
fix(s3api): missing `Vary: Origin` header on non-CORS and `OPTIONS` requests (#8072)
fix(s3api): missing `Vary: Origin` header on non-CORS and `OPTIONS` requests (#8072)
* fix: Refactor CORS middleware to consistently apply the `Vary: Origin` header when a configuration exists and streamline request processing logic. * fix: Add Vary: Origin header to CORS OPTIONS responses and refactor request handling for clarity and correctness. * fix: update CORS middleware tests to correctly parse and check for 'Origin' in Vary header. * refactor: extract `hasVaryOrigin` helper function to simplify Vary header checks in tests. * test: Remove `Vary: Origin` header from CORS test expectations. * refactor: consolidate CORS request handling into a new `processCORS` method using a `next` callback.pull/8082/head
committed by
GitHub
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
4 changed files with 197 additions and 85 deletions
-
4weed/s3api/cors/cors.go
-
2weed/s3api/cors/cors_test.go
-
115weed/s3api/cors/middleware.go
-
159weed/s3api/cors/middleware_test.go
Write
Preview
Loading…
Cancel
Save
Reference in new issue