marathon-lb icon indicating copy to clipboard operation
marathon-lb copied to clipboard

Cannot pass single backslash

Open vixns opened this issue 9 years ago • 0 comments

I want to pass a single backslash for a haproxy configuration directive http-response add-header Docker-Distribution-Api-Version:\ registry/2.0

The right label should be "HAPROXY_0_HTTPS_FRONTEND_ACL": " http-response add-header Docker-Distribution-Api-Version:\\ registry/2.0 if {{ ssl_fc_sni {hostname} }}\n use_backend {backend} if {{ ssl_fc_sni {hostname} }}\n" The backslash is escaped by another backslash, it should work, but fails.

The following works for MLB. "HAPROXY_0_HTTPS_FRONTEND_ACL": " http-response add-header Docker-Distribution-Api-Version:\\\\ registry/2.0 if {{ ssl_fc_sni {hostname} }}\n use_backend {backend} if {{ ssl_fc_sni {hostname} }}\n" but not for haproxy, because of the extra backslash in the generated configuration http-response add-header Docker-Distribution-Api-Version:\\ registry/2.0

Workaround (unofficial): "HAPROXY_0_HTTPS_FRONTEND_ACL": " http-response add-header Docker-Distribution-Api-Version:\\u005C registry/2.0 if {{ ssl_fc_sni {hostname} }}\n use_backend {backend} if {{ ssl_fc_sni {hostname} }}\n"

vixns avatar Mar 15 '17 14:03 vixns