no message
This commit is contained in:
@ -2,6 +2,7 @@ proxy更新日志
|
|||||||
v5.1
|
v5.1
|
||||||
1.优化了kcp默认mtu配置,调整为450.
|
1.优化了kcp默认mtu配置,调整为450.
|
||||||
2.优化了HTTP(S)\SOCKS5代理智能判断,更加精确。
|
2.优化了HTTP(S)\SOCKS5代理智能判断,更加精确。
|
||||||
|
3.fix #97 , 修复了RemoveProxyHeaders方法忽略了第一行的bug。
|
||||||
|
|
||||||
v5.0
|
v5.0
|
||||||
1.修复了SPS多端口无效的bug.
|
1.修复了SPS多端口无效的bug.
|
||||||
|
|||||||
@ -640,12 +640,18 @@ func RemoveProxyHeaders(head []byte) []byte {
|
|||||||
var keys = map[string]bool{}
|
var keys = map[string]bool{}
|
||||||
lines := bytes.Split(head, []byte("\r\n"))
|
lines := bytes.Split(head, []byte("\r\n"))
|
||||||
IsBody := false
|
IsBody := false
|
||||||
|
i := -1
|
||||||
for _, line := range lines {
|
for _, line := range lines {
|
||||||
|
i++
|
||||||
if len(line) == 0 || IsBody {
|
if len(line) == 0 || IsBody {
|
||||||
newLines = append(newLines, line)
|
newLines = append(newLines, line)
|
||||||
IsBody = true
|
IsBody = true
|
||||||
} else {
|
} else {
|
||||||
hline := bytes.SplitN(line, []byte(":"), 2)
|
hline := bytes.SplitN(line, []byte(":"), 2)
|
||||||
|
if i == 0 && IsHTTP(head) {
|
||||||
|
newLines = append(newLines, line)
|
||||||
|
continue
|
||||||
|
}
|
||||||
if len(hline) != 2 {
|
if len(hline) != 2 {
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user