twitter / finagle

A fault tolerant, protocol-agnostic RPC system
https://twitter.github.io/finagle
Apache License 2.0
8.78k stars 1.45k forks source link

Cors Filter does an add to the HeaderMap instead of set #952

Open SaumyaSoman opened 1 year ago

SaumyaSoman commented 1 year ago

Describe the bug Cors Filter does an add to the HeaderMap in setOriginAndCredentials and addExposedHeaders methods . This will add a header without replace existing headers.

To Reproduce Create a non preflight request with origin and expose headers and add cors filter to it. Call the API couple of times. Headers keep increasing.

Expected behavior A set should be done instead of add