Skip to content

Commit 11e288c

Browse files
committed
BUG/MINOR: add h1-accept-payload-with-any-method and h1-do-not-close-on-insecure-transfer-encoding to global
1 parent 852fd16 commit 11e288c

File tree

9 files changed

+62
-2
lines changed

9 files changed

+62
-2
lines changed

config-parser/section-parsers.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -442,6 +442,8 @@ func (p *configParser) getGlobalParser() *Parsers { //nolint: maintidx
442442
addParser(parser, &sequence, &simple.Number{Name: "ocsp-update.mindelay"})
443443
addParser(parser, &sequence, &simple.Number{Name: "ocsp-update.maxdelay"})
444444
addParser(parser, &sequence, &simple.OnOff{Name: "ocsp-update.mode"})
445+
addParser(parser, &sequence, &simple.Enabled{Name: "h1-accept-payload-with-any-method"})
446+
addParser(parser, &sequence, &simple.Enabled{Name: "h1-do-not-close-on-insecure-transfer-encoding"})
445447
// the ConfigSnippet must be at the end to parsers load order to ensure
446448
// the overloading of any option has been declared previously
447449
addParser(parser, &sequence, &parsers.ConfigSnippet{})

configuration/global.go

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2164,6 +2164,18 @@ func ParseGlobalSection(p parser.Parser) (*models.Global, error) { //nolint:goco
21642164
}
21652165
global.H1CaseAdjustFile = h1CaseAdjustFile
21662166

2167+
h1AcceptPayloadWithAnyMethod, err := parseBoolOption(p, "h1-accept-payload-with-any-method")
2168+
if err != nil {
2169+
return nil, err
2170+
}
2171+
global.H1AcceptPayloadWithAnyMethod = h1AcceptPayloadWithAnyMethod
2172+
2173+
h1DoNotCloseOnInsecureTransferEncoding, err := parseBoolOption(p, "h1-do-not-close-on-insecure-transfer-encoding")
2174+
if err != nil {
2175+
return nil, err
2176+
}
2177+
global.H1DoNotCloseOnInsecureTransferEncoding = h1DoNotCloseOnInsecureTransferEncoding
2178+
21672179
h2WorkaroundBogusWebsocketClients, err := parseBoolOption(p, "h2-workaround-bogus-websocket-clients")
21682180
if err != nil {
21692181
return nil, err
@@ -3015,6 +3027,14 @@ func SerializeGlobalSection(p parser.Parser, data *models.Global, opt *options.C
30153027
return err
30163028
}
30173029

3030+
if err := serializeBoolOption(p, "h1-accept-payload-with-any-method", data.H1AcceptPayloadWithAnyMethod); err != nil {
3031+
return err
3032+
}
3033+
3034+
if err := serializeBoolOption(p, "h1-do-not-close-on-insecure-transfer-encoding", data.H1DoNotCloseOnInsecureTransferEncoding); err != nil {
3035+
return err
3036+
}
3037+
30183038
if err := serializeTimeoutOption(p, "hard-stop-after", data.HardStopAfter, opt); err != nil {
30193039
return err
30203040
}

models/global_base.go

Lines changed: 6 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

models/global_base_compare.go

Lines changed: 16 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

models/global_base_compare_test.go

Lines changed: 6 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

specification/build/haproxy_spec.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1992,6 +1992,8 @@ definitions:
19921992
pattern: ^[^\s]+$
19931993
type: string
19941994
x-display-name: Group
1995+
h1_accept_payload_with_any_method:
1996+
type: boolean
19951997
h1_case_adjust:
19961998
items:
19971999
properties:
@@ -2009,6 +2011,8 @@ definitions:
20092011
x-omitempty: true
20102012
h1_case_adjust_file:
20112013
type: string
2014+
h1_do_not_close_on_insecure_transfer_encoding:
2015+
type: boolean
20122016
h2_workaround_bogus_websocket_clients:
20132017
type: boolean
20142018
hard_stop_after:

specification/models/configuration/global.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -208,6 +208,10 @@ global_base:
208208
type: string
209209
h1_case_adjust_file:
210210
type: string
211+
h1_accept_payload_with_any_method:
212+
type: boolean
213+
h1_do_not_close_on_insecure_transfer_encoding:
214+
type: boolean
211215
http_err_codes:
212216
type: array
213217
x-display-name: Replace, reduce or extend the list of status codes that define an error

test/configuration_test.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -162,6 +162,8 @@ global
162162
insecure-setuid-wanted
163163
issuers-chain-path issuers-chain-path
164164
h2-workaround-bogus-websocket-clients
165+
h1-accept-payload-with-any-method
166+
h1-do-not-close-on-insecure-transfer-encoding
165167
lua-load-per-thread file.ext
166168
mworker-max-reloads 5
167169
numa-cpu-mapping

test/expected/structured.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -170,6 +170,8 @@
170170
"grace": 10000,
171171
"group": "anderson",
172172
"h1_case_adjust_file": "/etc/headers.adjust",
173+
"h1_accept_payload_with_any_method": true,
174+
"h1_do_not_close_on_insecure_transfer_encoding": true,
173175
"h2_workaround_bogus_websocket_clients": true,
174176
"hard_stop_after": 2000,
175177
"http_client_options": {

0 commit comments

Comments
 (0)