Small fix
use the same code path in the unit test for setting the maxBodySize as the main program.
This commit is contained in:
parent
3ad2e79deb
commit
bab3cbc95e
|
@ -225,6 +225,7 @@ func RegisterHandlers(cf Config, mux *http.ServeMux) error {
|
|||
if hook.Concurrency < 1 {
|
||||
hook.Concurrency = 1
|
||||
}
|
||||
// allow hooks to have individual maxBodySize arguments.
|
||||
if cf.Settings.MaxBodySize > 0 && hook.maxBodySize == 0 {
|
||||
hook.maxBodySize = cf.Settings.MaxBodySize
|
||||
}
|
||||
|
|
|
@ -288,7 +288,7 @@ func TestHeaderAndBody(t *testing.T) {
|
|||
cf.Settings.BindAddress = "127.0.0.1:2088"
|
||||
cf.Settings.MaxBodySize = int64(len(bodyIncluded))
|
||||
cf.Hooks = make([]Hook, 0)
|
||||
cf.Hooks = append(cf.Hooks, Hook{Name: "hook", Command: fmt.Sprintf("tee %s", tempFile.Name()), Route: "/header_and_body", maxBodySize: cf.Settings.MaxBodySize})
|
||||
cf.Hooks = append(cf.Hooks, Hook{Name: "hook", Command: fmt.Sprintf("tee %s", tempFile.Name()), Route: "/header_and_body"})
|
||||
|
||||
listener, err := CreateListener(cf)
|
||||
if err != nil {
|
||||
|
|
Loading…
Reference in a new issue