-
Notifications
You must be signed in to change notification settings - Fork 4.8k
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
Sending multiple headers in Go HTTP filter with FilterCallbacks.SendLocalReply #31127
Comments
Adding extension owners: @doujiang24 @wangfakang @StarryVae @spacewander @antJack |
@doujiang24 and I discussed this months ago. We have a plan to add multiple headers support. But this is still a TODO as we don't have bandwidth to do it. @michaelsauter |
@spacewander I can give it a try, but it might take some time. Thanks for the pointer to the source file that likely needs changing. So just to be sure we are aligned - your intention is to have the signature updated to the following:
Correct? |
Yes.
|
yep, |
Sorry for not getting back earlier, I am currently unable to drive this further. I pushed what I did so far here: michaelsauter@2e1c769. I did not manage to add a test / run the tests yet because of an error (it seems to be the same as bazel-contrib/rules_foreign_cc#859). As this is my first time using Bazel / C++ it is not clear for me how to proceed and right now unfortunately I lack the time to look further into it :( |
@michaelsauter Thanks for your try, that's ok, I'll create a PR for it soon. |
Title: How to send multiple headers in Go HTTP filter with FilterCallbacks.SendLocalReply
Description:
I'm implementing a Go HTTP filter and I am trying to send multiple
Set-Cookie
headers. However, the type of theheaders
parameter in the signature ofenvoy/contrib/golang/common/go/api/filter.go
Line 155 in 75b5061
map[string]string
so I can't repeat the same header. In the specific case of cookies, it may be possible to separate multiple cookies by comma, but this is discouraged by RFC6265, and in my tests it didn't work. After some trial and error I found a working solution:However, that looks rather hacky and I wonder if this is how it is supposed to be? Is there a reason the type of
headers
isn'tmap[string][]string
in line with https://pkg.go.dev/net/http#Header? Or should this be considered a bug?The text was updated successfully, but these errors were encountered: