Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make sure quarkus.http.filter headers don't remove existing headers #38185

Merged
merged 1 commit into from
Jan 15, 2024

Conversation

geoand
Copy link
Contributor

@geoand geoand commented Jan 15, 2024

The previous behavior would completely replace
existing response headers

Fixes: #38155

This comment has been minimized.

Copy link
Member

@cescoffier cescoffier left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We need to verify how duplicates are handled.

Also, it needs to be marked as a breaking change.

The previous behavior would completely replace
existing response headers

Fixes: quarkusio#38155
@geoand
Copy link
Contributor Author

geoand commented Jan 15, 2024

PR updated with an improved test showing all cases.

It will no longer duplicate values

@geoand geoand changed the title Make sure quarkus.http.filter headers Make sure quarkus.http.filter headers don't remove existing headers Jan 15, 2024
Comment on lines +164 to +165
} else {
// we don't need to do anything here as the value was already in the set
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove the unnecessary else block then?

Suggested change
} else {
// we don't need to do anything here as the value was already in the set
} else {
// we don't need to do anything here as the value was already in the set

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wanted to keep it because of the comment

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see, but it seems to be explicit in your code already and the IDE nags about empty else blocks 😜

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I generally disable that inspection 😉

Copy link

quarkus-bot bot commented Jan 15, 2024

✔️ The latest workflow run for the pull request has completed successfully.

It should be safe to merge provided you have a look at the other checks in the summary.

You can consult the Develocity build scans.

@geoand geoand merged commit 136b4d8 into quarkusio:main Jan 15, 2024
50 checks passed
@quarkus-bot quarkus-bot bot added this to the 3.7 - main milestone Jan 15, 2024
@ia3andy
Copy link
Contributor

ia3andy commented Jan 16, 2024

@gsmet it might make sense to backport this?

@geoand
Copy link
Contributor Author

geoand commented Jan 16, 2024

It's a breaking change, so best not to

@geoand geoand deleted the #38155 branch January 16, 2024 06:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Using http filter config is disabling CORS options
5 participants