mirror of
https://github.com/xvzc/SpoofDPI.git
synced 2024-12-22 14:26:31 +00:00
add handling unexpected reequest format
This commit is contained in:
parent
7563f2b895
commit
1f74c89e77
@ -1,6 +1,7 @@
|
||||
package packet
|
||||
|
||||
import (
|
||||
"errors"
|
||||
"strings"
|
||||
)
|
||||
|
||||
@ -139,6 +140,10 @@ func parse(raw []byte) (string, string, string, string, string, error) {
|
||||
|
||||
tokens := strings.Split(firstLine, " ")
|
||||
|
||||
if (len(tokens) < 3) {
|
||||
return "", "", "", "", "", errors.New("Unexpected request format")
|
||||
}
|
||||
|
||||
method := tokens[0]
|
||||
url := tokens[1]
|
||||
version := tokens[2]
|
||||
|
Loading…
Reference in New Issue
Block a user