zilla icon indicating copy to clipboard operation
zilla copied to clipboard

Enhance http binding to support header inclusion, exclusion and injection

Open jfallows opened this issue 2 years ago • 0 comments

http binding currently supports the following options:

{
  "binding":
  {
    "options":
    {
      "overrides":
      {
        "extra-header-name": "extra-header-value"
      }
    }
  }
}

Even though this is referred to as overrides, the behavior is actually injection.

Instead we can support specific header inclusion, exclusion and injection.

{
  "binding":
  {
    "options":
    {
      "headers":
      {
        "includes": [ "*" ],     <-- defaults to all headers, backwards compatible
        "excludes": [ ],         <-- defaults to no exclusions, backwards compatible
        "injects":               <-- defaults to no injections, equivalent to `overrides`, backwards compatible
        {
          "extra-header-name": "extra-header-value"
        }
      }
    }
  }
}

Note we likely need to differentiate between request and response headers for full treatment Note we might need to expose this functionality per http binding route instead of just at the binding level.

jfallows avatar Oct 25 '22 22:10 jfallows