Skip to content

Commit 9c57025

Browse files
committed
feat: expose flag 'h1-accept-payload-with-any-method'
1 parent fc7ba28 commit 9c57025

File tree

5 files changed

+19
-27
lines changed

5 files changed

+19
-27
lines changed

ci/release_notes.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33

44
# New Features
55
- socat is directly executable due to a symlink
6+
- expose `h1-accept-payload-with-any-method` as `ha_proxy.always_allow_body_http10`
67

78
# Upgrades
89
- HAProxy 2.5.4 -> 2.5.7

haproxy-patches/disable-http10-body-in-get-request.patch

Lines changed: 0 additions & 27 deletions
This file was deleted.

jobs/haproxy/spec

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -677,3 +677,6 @@ properties:
677677
ha_proxy.enable_http2:
678678
description: Enables ingress (frontend) and egress (backend) HTTP/2 ALPN negotiation. Egress (backend) HTTP protocol version may be overriden by `ha_proxy.backend_ssl`, `ha_proxy.disable_backend_http2_websockets` and `ha_proxy.backend_match_http_protocol`.
679679
default: false
680+
ha_proxy.always_allow_body_http10:
681+
description: Always allow a body to be sent when using HTTP/1.0. By default HAProxy denies GET/HEAD/DELETE requests with a body when using HTTP/1.0 due to potential request smuggling attacks. See https://github.com/haproxy/haproxy/commit/e136bd12a32970bc90d862d5fe09ea1952b62974
682+
default: false

jobs/haproxy/templates/haproxy.config.erb

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -276,6 +276,9 @@ global
276276
<%- if backend_match_http_protocol && backends.length == 2 -%>
277277
set-var proc.h2_alpn_tag str(h2)
278278
<%- end -%>
279+
<%- if p("ha_proxy.always_allow_body_http10") %>
280+
h1-accept-payload-with-any-method
281+
<%- end %>
279282

280283
defaults
281284
log global

spec/haproxy/templates/haproxy_config/global_and_default_options_spec.rb

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -491,4 +491,16 @@
491491
expect(defaults).to include('option allbackups')
492492
end
493493
end
494+
495+
context 'when ha_proxy.always_allow_body_http10 is true' do
496+
let(:properties) do
497+
{
498+
'always_allow_body_http10' => true
499+
}
500+
end
501+
502+
it 'sets the global option' do
503+
expect(global).to include('h1-accept-payload-with-any-method')
504+
end
505+
end
494506
end

0 commit comments

Comments
 (0)