Giter Club home page Giter Club logo

Comments (4)

sgayangi avatar sgayangi commented on July 18, 2024

There are 5 filters in total:

Of these 5,

  • ExtensionRef
  • HTTPURLRewriteFilter
  • HTTPHeaderFilter (add, set and remove)
    are functional in APK.

The sample HTTPRoute filters used for testing HTTPHeaderFilter are given below:

  1. requestHeaderModifier:
- type: "RequestHeaderModifier"
  requestHeaderModifier:
    add:
      - name: X-Request-Custom-Header
        value: "Request-Custom-Header"
    set:
      - name: User-Agent
        value: "Replaced existing value for user agent"
    remove: ["Postman-Token"]
  1. responseHeaderModifier:
- type: "ResponseHeaderModifier"
  responseHeaderModifier:
    add:
      - name: X-Response-Custom-Header
        value: "Response-Custom-Header"
    set:
      - name: data
        value: "Replaced existing value for data from backend response"
    remove: ["access-control-allow-credentials"]

from apk.

sgayangi avatar sgayangi commented on July 18, 2024

HTTPRequestMirrorFilter

  • Mirrors requests to the backends specified under the filter
  • Needs to be given a backendRef to mirror the request to
  • The request is sent to the original backendRef provided under the rule as well
  • However, the responses from the backend provided under the filter will be ignored; only the response from the original backend will be sent back to the client.

Sample:

- type: "RequestMirror"
  requestMirror:
    backendRef:
      group: "dp.wso2.com"
      kind: "Backend"
      name: "backend-736990a5eefb375887fdb20008ff04c43a8d3796-api"

https://www.envoyproxy.io/docs/envoy/latest/start/sandboxes/route-mirror

from apk.

sgayangi avatar sgayangi commented on July 18, 2024

HTTPRequestRedirectFilter

  • Redirects the request to the specified URL
  • Cannot be used on the same rule as a URLRewrite
  • Cannot have a backendRef in that match either
- type: "RequestRedirect"
  requestRedirect:
    scheme: "https"
    hostname: "webhook.site"
    path:
      type: "ReplaceFullPath"
      replaceFullPath: "/e961947c-0607-4d9d-9fe9-c7489cba84f8"
    port: 443
    statusCode: 301

from apk.

sgayangi avatar sgayangi commented on July 18, 2024

Subtasks

from apk.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.