resHeaders
Dynamically modify response header information, supporting multiple data sources and batch operations.
Rule Syntax
txt
pattern resHeaders://value [filters...]
Parameters | Description | Detailed Documentation |
---|---|---|
pattern | Expression to match request URLs | Match Pattern Documentation |
value | Operation data object, supported from the following channels: • Directory/file path • Remote URL • Inline/embedded/Values content | Operation Instruction Documentation |
filters | Optional 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
Related Protocols
- More flexible way to modify response headers: headerReplace
- Deleting response header fields: delete://resHeaders.xxx