-
Notifications
You must be signed in to change notification settings - Fork 457
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
Clarify documentation of RequestHeaderModifier .set
and .add
behaviour
#3314
Comments
I think the issue here is that we haven't been clear enough about the expected behavior.
That's how you can edit a header that's already existing -
If you are looking for "edit this value if present and don't do anything if not", I don't think we have a way to do that at the moment. From what I can see above, Traefik is behaving according to the spec. |
That's what I was expecting @youngnick, and I'm glad to hear that this is the intended behaviour. Then I think it should just be clarified in the docs, as it now reads:
Which for me implies that |
.set
and .add
behaviour.set
and .add
behaviour
Yes, I agree that line could be changed to something more like:
or something. Does that make more sense to you @FredrikAugust? |
It stills appears a little self-contradictory to me as the first sentence reads "existing header" which implies that the header has to be there in the first place — which we have established is not the case. What about:
|
What would you like to be added:
The documentation for
set
currently reads:However, according to the implementation by Traefik it actually sets it regardless of it exists or not. Go playground
This also goes for the
add
functionality, which according to the implementation in Traefik will add values iteratively, i.e. if an incoming request already has headerx-header
set tovalue
and you add theadd
filter withvalue2
the actual header value will bevalue,value2
. This is just a clarification I think could be useful to add.If this is a wrong implementation by Traefik then let me know and I'll move the issue over there.
Why this is needed:
To avoid confusion when using the filters.
The text was updated successfully, but these errors were encountered: