mirror of
https://github.com/caddyserver/caddy.git
synced 2024-12-27 06:03:48 +03:00
parent
897a38958c
commit
e2991eb019
2 changed files with 10 additions and 10 deletions
|
@ -32,12 +32,12 @@ func init() {
|
||||||
// parseCaddyfile sets up the handler for response headers from
|
// parseCaddyfile sets up the handler for response headers from
|
||||||
// Caddyfile tokens. Syntax:
|
// Caddyfile tokens. Syntax:
|
||||||
//
|
//
|
||||||
// header [<matcher>] [[+|-|?]<field> [<value|regexp>] [<replacement>]] {
|
// header [<matcher>] [[+|-|?]<field> [<value|regexp>] [<replacement>]] {
|
||||||
// [+]<field> [<value|regexp> [<replacement>]]
|
// [+]<field> [<value|regexp> [<replacement>]]
|
||||||
// ?<field> <default_value>
|
// ?<field> <default_value>
|
||||||
// -<field>
|
// -<field>
|
||||||
// [defer]
|
// [defer]
|
||||||
// }
|
// }
|
||||||
//
|
//
|
||||||
// Either a block can be opened or a single header field can be configured
|
// Either a block can be opened or a single header field can be configured
|
||||||
// in the first line, but not both in the same directive. Header operations
|
// in the first line, but not both in the same directive. Header operations
|
||||||
|
@ -148,8 +148,7 @@ func parseCaddyfile(h httpcaddyfile.Helper) ([]httpcaddyfile.ConfigValue, error)
|
||||||
// parseReqHdrCaddyfile sets up the handler for request headers
|
// parseReqHdrCaddyfile sets up the handler for request headers
|
||||||
// from Caddyfile tokens. Syntax:
|
// from Caddyfile tokens. Syntax:
|
||||||
//
|
//
|
||||||
// request_header [<matcher>] [[+|-]<field> [<value|regexp>] [<replacement>]]
|
// request_header [<matcher>] [[+|-]<field> [<value|regexp>] [<replacement>]]
|
||||||
//
|
|
||||||
func parseReqHdrCaddyfile(h httpcaddyfile.Helper) ([]httpcaddyfile.ConfigValue, error) {
|
func parseReqHdrCaddyfile(h httpcaddyfile.Helper) ([]httpcaddyfile.ConfigValue, error) {
|
||||||
if !h.Next() {
|
if !h.Next() {
|
||||||
return nil, h.ArgErr()
|
return nil, h.ArgErr()
|
||||||
|
|
|
@ -782,8 +782,9 @@ func (h *Handler) reverseProxy(rw http.ResponseWriter, req *http.Request, origRe
|
||||||
copyHeader(h, http.Header(header))
|
copyHeader(h, http.Header(header))
|
||||||
rw.WriteHeader(code)
|
rw.WriteHeader(code)
|
||||||
|
|
||||||
// Clear headers, it's not automatically done by ResponseWriter.WriteHeader() for 1xx responses
|
// Clear headers coming from the backend
|
||||||
for k := range h {
|
// (it's not automatically done by ResponseWriter.WriteHeader() for 1xx responses)
|
||||||
|
for k := range header {
|
||||||
delete(h, k)
|
delete(h, k)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue