From 5d83f5a0288053c3319c5248db0a3735b88f4270 Mon Sep 17 00:00:00 2001 From: Hermes Agent Date: Wed, 29 Jul 2026 09:31:47 -0400 Subject: [PATCH] fix archive PUTs missing content type --- root/templates/haproxy.cfg | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/root/templates/haproxy.cfg b/root/templates/haproxy.cfg index 015611c..1fd4a6a 100644 --- a/root/templates/haproxy.cfg +++ b/root/templates/haproxy.cfg @@ -25,6 +25,11 @@ backend docker frontend proxy bind @@BIND_PROTO@@ + # Docker's archive extraction endpoint only consumes tar request bodies when + # their media type is application/x-tar. Supply the documented media type + # when clients omit Content-Type rather than forwarding a request that the + # daemon acknowledges with 200 while extracting nothing. + http-request set-header Content-Type application/x-tar if METH_PUT { path,url_dec -m reg -i ^(/v[\d\.]+)?/containers/[a-zA-Z0-9_.-]+/archive$ } !{ req.hdr(Content-Type) -m found } http-request allow if { path,url_dec -m reg -i ^(/v[\d\.]+)?/containers/[a-zA-Z0-9_.-]+/((stop)|(restart)|(kill)) } { env(ALLOW_RESTARTS) -m bool } http-request allow if { path,url_dec -m reg -i ^(/v[\d\.]+)?/containers/[a-zA-Z0-9_.-]+/start } { env(ALLOW_START) -m bool } http-request allow if { path,url_dec -m reg -i ^(/v[\d\.]+)?/containers/[a-zA-Z0-9_.-]+/stop } { env(ALLOW_STOP) -m bool }