Skip to content

Commit 6ee0d07

Browse files
Hermes Agentphattbeats
authored andcommitted
fix archive PUTs missing content type
1 parent ab9f088 commit 6ee0d07

1 file changed

Lines changed: 6 additions & 0 deletions

File tree

‎root/templates/haproxy.cfg‎

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,12 @@ frontend proxy
4040
http-request deny if { path,url_dec -m reg -i ^(/v[\d\.]+)?(/libpod)?/(containers|pods)/[a-zA-Z0-9_.-]+/(logs) } !allow_logs
4141
http-request deny if { path,url_dec -m reg -i ^(/v[\d\.]+)?(/libpod)?/(containers|pods)/[a-zA-Z0-9_.-]+/(top) } !allow_top
4242

43+
# Docker's archive extraction endpoint only consumes tar request bodies when
44+
# their media type is application/x-tar. Supply the documented media type
45+
# when clients omit Content-Type rather than forwarding a request that the
46+
# daemon acknowledges with 200 while extracting nothing.
47+
http-request set-header Content-Type application/x-tar if METH_PUT { path,url_dec -m reg -i ^(/v[\d\.]+)?(/libpod)?/(containers|pods)/[a-zA-Z0-9_.-]+/archive$ } !{ req.hdr(Content-Type) -m found }
48+
4349
http-request allow if { path,url_dec -m reg -i ^(/v[\d\.]+)?(/libpod)?/(containers|pods)/[a-zA-Z0-9_.-]+/((stop)|(restart)|(kill)) } { env(ALLOW_RESTARTS) -m bool }
4450
http-request allow if { path,url_dec -m reg -i ^(/v[\d\.]+)?(/libpod)?/(containers|pods)/[a-zA-Z0-9_.-]+/start } { env(ALLOW_START) -m bool }
4551
http-request allow if { path,url_dec -m reg -i ^(/v[\d\.]+)?(/libpod)?/(containers|pods)/[a-zA-Z0-9_.-]+/stop } { env(ALLOW_STOP) -m bool }

0 commit comments

Comments
 (0)