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

How can we get the http Cookie when dgp.filter.http.dubboproxy has been chosen #598

Open
18761396502 opened this issue Dec 4, 2023 · 1 comment
Labels
good first issue Good for newcomers

Comments

@18761396502
Copy link

What would you like to be added:
I would like to ask a module which can be used to transform the http request with its Cookie to the Dubbo request so that I can get the Cookie in my Dubbo cluster. The optimal way of usage is that I choose the dgp.filter.http.dubboproxy and at the same time I can get the Cookie with the request body, then I can send then response with the Cookie too. In simple terms, I would like to find a way to add the http Cookie within the whole system which has used the Pixiu as the gateway and the dgp.filter.http.dubboproxy as the filter.

Why is this needed:
Because of the way of authentication we has chosen, we must get the Cookie almost everywhere in the system. But now I have no idea about how to get the Cookie through the dgp.filter.http.dubboproxy filter in Pixiu.

@baerwang
Copy link
Member

baerwang commented Dec 8, 2023

func (f *Filter) Decode(c *contexthttp.HttpContext) filter.FilterStatus {

you can get cookie in this code

 c.Request.Header.Get("Cookie")

@AlexStocks AlexStocks added the good first issue Good for newcomers label Dec 8, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

3 participants