Browse Source

reverseproxy: Add `buffer_requests` option to `reverse_proxy` directive (#3710)

master
Francis Lavoie 4 years ago
committed by GitHub
parent
commit
4cd7ae35b3
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 2
      caddytest/integration/caddyfile_adapt/reverse_proxy_h2c.txt
  2. 6
      modules/caddyhttp/reverseproxy/caddyfile.go

2
caddytest/integration/caddyfile_adapt/reverse_proxy_h2c.txt

@ -10,6 +10,7 @@ https://example.com {
versions h2c 2 versions h2c 2
compression off compression off
} }
buffer_requests
} }
} }
@ -38,6 +39,7 @@ https://example.com {
{ {
"handle": [ "handle": [
{ {
"buffer_requests": true,
"handler": "reverse_proxy", "handler": "reverse_proxy",
"headers": { "headers": {
"request": { "request": {

6
modules/caddyhttp/reverseproxy/caddyfile.go

@ -467,6 +467,12 @@ func (h *Handler) UnmarshalCaddyfile(d *caddyfile.Dispenser) error {
h.FlushInterval = caddy.Duration(dur) h.FlushInterval = caddy.Duration(dur)
} }
case "buffer_requests":
if d.NextArg() {
return d.ArgErr()
}
h.BufferRequests = true
case "header_up": case "header_up":
if h.Headers == nil { if h.Headers == nil {
h.Headers = new(headers.Handler) h.Headers = new(headers.Handler)

Loading…
Cancel
Save