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

[BUG] Add "Vary" header only if value not already present #256

Open
1 task done
gaston-haro opened this issue Apr 2, 2024 · 1 comment
Open
1 task done

[BUG] Add "Vary" header only if value not already present #256

gaston-haro opened this issue Apr 2, 2024 · 1 comment
Labels

Comments

@gaston-haro
Copy link

Is there an existing issue for this?

  • I have searched the existing issues

Current Behavior

Responses may end up with duplicate header key:value for "Vary:Accept-Encoding"

Expected Behavior

Adding the header value should only be done if it is not already present.

Steps To Reproduce

No response

Anything else?

w.Header().Add("Vary", acceptEncoding)

@gaston-haro gaston-haro added the bug label Apr 2, 2024
@gaston-haro
Copy link
Author

-		w.Header().Add("Vary", acceptEncoding)
+		if w.Header().Get("Vary") != acceptEncoding {
+			w.Header().Add("Vary", acceptEncoding)
+		}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant