markusahlstrand / cloudworker-proxy

An api gateway for cloudflare workers
MIT License
194 stars 22 forks source link

The response handler should template headers #58

Closed markusahlstrand closed 4 years ago

markusahlstrand commented 4 years ago

If the response handler templated headers as well it would be possible to make a simple redirect to https rule like this:

  {
    "handlerName": "response",
    "host": "example.com",
    "protocol": "http",
    "path": "/:file*",
    "options": {
      "status": 301,
      "body": "Redirecting to https",
      "headers": {
        "location": "https://example.com/{file}"
      }
    }
  },