spring-cloud-gateway icon indicating copy to clipboard operation
spring-cloud-gateway copied to clipboard

Pass preflight request to upstream. Fixes gh-2472

Open tommas1988 opened this issue 3 years ago • 7 comments

Pass preflight request to upstream. Fixes issue 2472

tommas1988 avatar Apr 10 '22 09:04 tommas1988

Sorry for the late reply. This needs to be opt-in since it is a change from the default behavior. Are you able to make that change?

spencergibb avatar Nov 15 '22 14:11 spencergibb

Are you able to make that chang

Sorry for the late reply. This needs to be opt-in since it is a change from the default behavior. Are you able to make that change?

Sorry I don`t get the meaning of 'opt-in'. What can I do with this PR ?

tommas1988 avatar Nov 16 '22 01:11 tommas1988

It needs to be activated by a property. Other people rely on the current behavior. Those that want this new behavior need to opt in by setting a property. I'm asking if you can add that to the PR

spencergibb avatar Nov 16 '22 02:11 spencergibb

It needs to be activated by a property. Other people rely on the current behavior. Those that want this new behavior need to opt in by setting a property. I'm asking if you can add that to the PR

There is a boolean setting item named handle-preflight-request in route setting to control this behavior. And it is disabled by default.

tommas1988 avatar Nov 16 '22 06:11 tommas1988

I will add some docs for this feature some time later

tommas1988 avatar Nov 16 '22 11:11 tommas1988

After recalling the related bug and code review, I'm going to refactor the codes. It seems useless to implement PreFlightRequestFilter interface on every GatewayFilters

tommas1988 avatar Nov 17 '22 01:11 tommas1988

PreFlightRequestFilter interface is still needed to allow only filters that affect route process to handle preflight request.

tommas1988 avatar Nov 21 '22 17:11 tommas1988