Skip to content

resHeaders

Dynamically modify response header information, supporting multiple data sources and batch operations.

Rule Syntax

txt
pattern resHeaders://value [filters...]
ParametersDescriptionDetailed Documentation
patternExpression to match request URLsMatch Pattern Documentation
valueOperation data object, supported from the following channels:
• Directory/file path
• Remote URL
• Inline/embedded/Values content
Operation Instruction Documentation
filtersOptional filters, supported for matching:
• Request URL/method/header/content
• Response status code/header
Filter Documentation

Configuration Example

Basic Configuration

txt
www.example.com/path resHeaders://x-proxy=Whistle

Access https://www.example.com/path/to adds a new response header:

txt
x-proxy: Whistle

Setting Multiple Response Headers

txt
``` test.json
x-test1: 1
x-test2:
x-test3: abc
```
www.example.com/path2 resHeaders://{test.json}

# Equivalent to: www.example.com/path2 resHeaders://x-test1=1&x-test2=&x-test3=abc

Visiting https://www.example.com/path2/to on Whistle Network or the backend server will show the new response header:

txt
x-test1: 1
x-test2:
x-test3: abc

Local/Remote Resources

txt
www.example.com/path1 resHeaders:///User/xxx/test.json
www.example.com/path2 resHeaders://https://www.xxx.com/xxx/params.json
# Editing a temporary file
www.example.com/path3 resHeaders://temp/blank.json
  1. Modify response headers: resHeaders
  2. Delete request header field (Delete Response Header): delete://resHeaders.xxx
  3. Delete request cookie (Delete Response Cookie): delete://resCookies.xxx
  4. Set request cookie: resCookies
  5. Set cache: cache
  6. More flexible way to modify request headers: headerReplace