Compare commits
2 Commits
9dfef1d67f
...
6a513bbcac
| Author | SHA1 | Date | |
|---|---|---|---|
| 6a513bbcac | |||
| 69e61c5811 |
@@ -123,8 +123,8 @@ type HTTPFuzzTestCase struct {
|
||||
}
|
||||
|
||||
func (h *FuzzTestHelper) validateHTTPRequest(t *testing.T, req *http.Request) {
|
||||
pathParts := strings.Split(req.URL.Path, "/")
|
||||
for _, part := range pathParts {
|
||||
pathParts := strings.SplitSeq(req.URL.Path, "/")
|
||||
for part := range pathParts {
|
||||
if !utf8.ValidString(part) {
|
||||
t.Fatal("Path contains invalid UTF-8")
|
||||
}
|
||||
|
||||
@@ -40,12 +40,7 @@ func (f *FuzzInputValidator) ValidateFuzzInputStrict(data []byte) bool {
|
||||
}
|
||||
|
||||
input := string(data)
|
||||
|
||||
if len(strings.TrimSpace(input)) == 0 {
|
||||
return false
|
||||
}
|
||||
|
||||
return true
|
||||
return len(strings.TrimSpace(input)) != 0
|
||||
}
|
||||
|
||||
func ValidateUTF8String(s string) {
|
||||
@@ -210,8 +205,8 @@ func (r *FuzzHTTPRequest) CreateTestRequest(method, url string, body []byte, hea
|
||||
}
|
||||
|
||||
func (r *FuzzHTTPRequest) ValidateHTTPRequest(req *http.Request) {
|
||||
pathParts := strings.Split(req.URL.Path, "/")
|
||||
for _, part := range pathParts {
|
||||
pathParts := strings.SplitSeq(req.URL.Path, "/")
|
||||
for part := range pathParts {
|
||||
ValidateUTF8String(part)
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user