RouteFilter to Rewrite prefix before redirect

RouteFilter to rewrite prefix before redirect

Use this filter when a redirect response is required with a rewritten prefix

Filter Config

apiVersion: enroute.saaras.io/v1
kind: RouteFilter
  name: prefix-redirect-to-v2-filter
  namespace: httpbin
spec:
  name: prefix-redirect-to-v2-filter
  routeFilterConfig:
    config: |
      {
            "prefix_rewrite" : "/v2"
      }
  type: route_filter_redirect

An example Route in a GatewayHost that utilizes this is shown below -

GatewayHost config

apiVersion: enroute.saaras.io/v1
kind: GatewayHost
metadata:
  name: httpbin-9000-gatewayhost-httpbin-host
  namespace: httpbin
spec:
  routes:
  - conditions:
    - prefix: /v1
    filters:
    - name: prefix-redirect-to-v2-filter
      type: route_filter_redirect
    services:
    - name: httpbin
      port: 9000
  virtualhost:
    fqdn: '*'