rack-cors icon indicating copy to clipboard operation
rack-cors copied to clipboard

issue comeback duplicate headers because of header name case

Open eugene-ruby opened this issue 2 years ago • 3 comments

I use rake version 2.2.6.2 and don't update because have dependencies

` Bundler could not find compatible versions for gem "rack": In Gemfile: rack (~> 3)

rails (~> 6.1.7.2) was resolved to 6.1.7.2, which depends on
  actionpack (= 6.1.7.2) was resolved to 6.1.7.2, which depends on
    rack (~> 2.0, >= 2.0.9)

`

But after merged PR https://github.com/cyu/rack-cors/pull/252

I get duplicate headers

curl -I 'http://localhost:3000/api-docs' -H 'Origin: http://127.0.0.1:3001'
HTTP/1.1 200 OK
access-control-allow-origin: *
access-control-allow-methods: GET, POST, PUT, DELETE, OPTIONS, HEAD
access-control-expose-headers:
access-control-max-age: 7200
Access-Control-Allow-Origin: *
Access-Control-Request-Method: *
Content-Type: application/json
Cache-Control: no-cache
X-Request-Id: ee0ae55d5e1846be8462e897bbc892ea
X-Runtime: 0.120744
x-rack-cors-original-access-control-allow-origin: *
x-rack-cors-original-access-control-allow-methods: GET, POST, PUT, DELETE, OPTIONS, HEAD
x-rack-cors-original-access-control-expose-headers:
x-rack-cors-original-access-control-max-age: 7200
vary: Origin
x-rack-cors: hit
Content-Length: 0

I suggest checking version rake and call Rack::Utils::HeaderHash or simple return h

eugene-ruby avatar Mar 07 '23 08:03 eugene-ruby

please see PR https://github.com/cyu/rack-cors/pull/260

eugene-ruby avatar Mar 07 '23 08:03 eugene-ruby

i have same problem. troubles to use swagger ui image image

Xeej avatar Mar 14 '23 10:03 Xeej

This ticket can be closed as fix is merged.

johnnyshields avatar Mar 17 '23 05:03 johnnyshields