forked from yahoo/webseclab
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcustom_test.go
43 lines (35 loc) · 878 Bytes
/
custom_test.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
// Copyright 2015, Yahoo Inc. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
package webseclab
import "net/http"
type MockResponseWriter struct {
header http.Header
}
func NewMockResponseWriter() MockResponseWriter {
m := MockResponseWriter{}
m.header = make(http.Header)
return m
}
func (r MockResponseWriter) Header() (header http.Header) {
return r.header
}
func (r MockResponseWriter) Write([]byte) (int, error) {
return 0, nil
}
func (r MockResponseWriter) WriteHeader(int) {
return
}
// func TestXssDoubq1(t *testing.T) {
// t.Parallel()
// var w = NewMockResponseWriter()
// path := "/a/b/c"
// req, err := http.NewRequest("GET", path, nil)
// if err != nil {
// t.Error(err)
// }
// resp := XssDoubq1(w, req)
// if resp.Err != nil {
// t.Error(resp.Err)
// }
// }