Browse Source

Update weed/s3api/s3api_object_handlers.go

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
pull/6987/head
Chris Lu 3 months ago
committed by GitHub
parent
commit
456c3ce717
No known key found for this signature in database GPG Key ID: B5690EEEBB952194
  1. 8
      weed/s3api/s3api_object_handlers.go

8
weed/s3api/s3api_object_handlers.go

@ -393,11 +393,11 @@ func setUserMetadataKeyToLowercase(resp *http.Response) {
}
func passThroughResponse(proxyResponse *http.Response, w http.ResponseWriter) (statusCode int, bytesTransferred int64) {
// Preserve existing CORS headers that may have been set by middleware
existingCORSHeaders := make(map[string][]string)
// Capture existing CORS headers that may have been set by middleware
capturedCORSHeaders := make(map[string]string)
for _, corsHeader := range corsHeaders {
if values, ok := w.Header()[corsHeader]; ok {
existingCORSHeaders[corsHeader] = append([]string{}, values...)
if value := w.Header().Get(corsHeader); value != "" {
capturedCORSHeaders[corsHeader] = value
}
}

Loading…
Cancel
Save