Open HeartIsBeat opened 2 years ago
There is a bug here.
if len(m.config.HeaderRewrite) > 0 {
for _, f := range m.config.HeaderRewrite {
value := proto.Header(payload, f.header)
if len(value) == 0 {
break <<<<<<<<<< if header "authorization" is not found, it will not try the left "authorization-virtual"
}
if f.src.Match(value) {
newValue := f.src.ReplaceAll(value, f.target)
payload = proto.SetHeader(payload, f.header, newValue)
}
}
}
I will submit a fix for this.
I use gor1.3.3 wget https://github.com/buger/goreplay/releases/download/1.3.3/gor_1.3.3_x64.tar.gz
gor record traffic like this:
or like this:
![image](https://user-images.githubusercontent.com/20472976/184072513-d75b56e5-eadf-48a1-86b2-be16fb12f30c.png)
I want to rewrite header: authorization and authorization-virtual. using
--http-rewrite-header 'authorization: XDS [a-zA-Z0-9.-_/+/-]+,xxx' --http-rewrite-header 'authorization-virtual: VDS [a-zA-Z0-9.-_/+/-]+,VDS xxx'
authorization can be rewrited. But authorization-virtual can't be rewrited