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

fix:POST request body is missing #260

Merged
merged 3 commits into from
Oct 1, 2021
Merged
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions pkg/filter/http/httpproxy/routerfilter.go
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,8 @@ type (
}
// Filter is http filter instance
Filter struct {
cfg *Config
cfg *Config
transport http3.RoundTripper
}
// Config describe the config of Filter
Config struct{}
Expand All @@ -59,7 +60,7 @@ func (p *Plugin) Kind() string {
}

func (p *Plugin) CreateFilter() (filter.HttpFilter, error) {
return &Filter{cfg: &Config{}}, nil
return &Filter{cfg: &Config{}, transport: &http3.Transport{}}, nil
}

func (f *Filter) Config() interface{} {
Expand Down Expand Up @@ -133,7 +134,7 @@ func (f *Filter) Handle(hc *http.HttpContext) {
req.Header = r.Header

errPrefix = "do request"
resp, err := http3.DefaultClient.Do(req)
resp, err := (&http3.Client{Transport: f.transport}).Do(req)
if err != nil {
panic(err)
}
Expand Down