mirror of
https://github.com/gin-gonic/gin.git
synced 2025-10-14 12:12:12 +08:00
Merge cb0a76caf675620bb3268153128ca2adac317d9a into 077a2f39c85700ba0823f85ed29cec0c8f2cbdfc
This commit is contained in:
commit
0627a5f965
21
render/fuzz.go
Normal file
21
render/fuzz.go
Normal file
@ -0,0 +1,21 @@
|
||||
// Copyright 2020 Manu Martinez-Almeida. All rights reserved.
|
||||
// Use of this source code is governed by a MIT style
|
||||
// license that can be found in the LICENSE file.
|
||||
|
||||
// +build gofuzz
|
||||
|
||||
package render
|
||||
|
||||
import (
|
||||
"net/http/httptest"
|
||||
)
|
||||
|
||||
func FuzzRender(data []byte) int {
|
||||
w := httptest.NewRecorder()
|
||||
(YAML{string(data)}).WriteContentType(w)
|
||||
err := (YAML{string(data)}).Render(w)
|
||||
if err != nil {
|
||||
return 0
|
||||
}
|
||||
return 1
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user