mirror of
https://github.com/xvzc/SpoofDPI.git
synced 2024-12-22 14:26:31 +00:00
update http packet parsing method
This commit is contained in:
parent
b7a76ab5ec
commit
45a990d296
@ -90,7 +90,7 @@ func (p *HttpPacket) IsConnectMethod() bool {
|
|||||||
func (p *HttpPacket) Tidy() {
|
func (p *HttpPacket) Tidy() {
|
||||||
s := string(p.raw)
|
s := string(p.raw)
|
||||||
|
|
||||||
lines := strings.Split(s, "\n")
|
lines := strings.Split(s, "\r\n")
|
||||||
|
|
||||||
lines[0] = p.method + " " + p.path + " " + p.version
|
lines[0] = p.method + " " + p.path + " " + p.version
|
||||||
|
|
||||||
@ -101,14 +101,17 @@ func (p *HttpPacket) Tidy() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
result := ""
|
result := ""
|
||||||
|
|
||||||
for i := 0; i < len(lines); i++ {
|
for i := 0; i < len(lines); i++ {
|
||||||
if lines[i] == "" {
|
if lines[i] == "" {
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
|
|
||||||
result += lines[i] + "\n"
|
result += lines[i] + "\r\n"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
result += "\r\n"
|
||||||
|
|
||||||
p.raw = []byte(result)
|
p.raw = []byte(result)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user