mirror of
https://github.com/gin-gonic/gin.git
synced 2026-07-04 09:11:23 +08:00
Compare commits
2 Commits
4b8a8a7921
...
3debf3d15d
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
3debf3d15d | ||
|
|
cb0a76caf6 |
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