mesosphere / marathon-lb

Marathon-lb is a service discovery & load balancing tool for DC/OS
Apache License 2.0
450 stars 300 forks source link

Cutom headers missing when using path based routing #668

Closed raghu999 closed 4 years ago

raghu999 commented 4 years ago

Hi, We are seeing an issue after upgrading from Marathon-LB 1.12.0 to 1.14.2 with path-based routing. All the custom headers are being dropped and not being sent to the backend. Is this an issue with haproxy version or marathon-lb?

Marathon-LB configuration:

  "labels": {
    "HAPROXY_GROUP": "external",
    "HAPROXY_0_BACKEND_HTTP_OPTIONS": "  option httplog\n option forwardfor\n  http-request set-header X-Forwarded-Port %[dst_port]\n  http-request add-header X-Forwarded-Proto https if { ssl_fc }\n",
    "HAPROXY_0_PATH": "-i /mobile",
    "HAPROXY_0_VHOST": "stg-chicago.example.net ,stg.example.net ",
    "HAPROXY_0_HTTPS_FRONTEND_ACL_ONLY_WITH_PATH": "  acl path_{backend} path_beg {path}\n use_backend {backend} if path_{backend}\n"
  },
HQSMLrchalla$ curl --location --request PUT 'https://stg-chicago.example.net/mobile/devices/hh::fedsdsdsdsdTLKrBA:AdfdfdfdA91bFvln4f6iVsksPpATVeLmzXHhEudWZGWrsC0ldaoSRLMCGIPH5PCPUFIFBMZFA5gzH3dTtTEeT3oP6kktVu8a0l2T4l9x4OfLzpOpYrnvc2qV3Iz' --header 'Content-Type: application/json' --header 'OAuth-Consumer-Key: scRdfsfsfsdfdsfdsfsdfdsfsdfsd0xdxEq' --data-raw '{
    "consumerName" : "hh",
    "token" : "fe3f4TLKrfadfafaffadfadfadfadfafadfadfadfdafadfdafadfafadfTEeT3oP6kktVu8a0l2T4l9x4OfLzpOpqpNTQtljJLT9c3fMBTqXbsfYrnvc2qV3Iz",
    "deviceType" : "ios",
   "subscriptions":  ["/hh/demo"]
}'

"Expected OAuth-Consumer-Key or Authorization header"

The above query/request is failing only in the latest version 1.14.2 and is still working as expected in 1.12.0 version

PS: Path-based routing, in general, is working fine it is only failing when the backend expects headers in the request

raghu999 commented 4 years ago

Closing this for anyone facing this issue, Not sure if it marathon-lb or haproxy 2.0 the headers are getting normalized the OAuth-Consumer-Key is now being presented to backend app as oauth-consumer-key we changed our app to accept case insensitive headers and everything is working fine now