Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit b105299

Browse files
committed
spelling: against
Signed-off-by: Josh Soref <[email protected]>
1 parent 21caa4b commit b105299

3 files changed

Lines changed: 9 additions & 9 deletions

File tree

go/ql/src/experimental/CWE-369/DivideByZero.qhelp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ possibly causing a divide-by-zero panic.
1818
</p>
1919
<sample src="DivideByZeroBad.go" />
2020
<p>
21-
This can be fixed by testing the divisor against against zero:
21+
This can be fixed by testing the divisor against zero:
2222
</p>
2323
<sample src="DivideByZeroGood.go" />
2424
</example>

go/ql/test/experimental/CWE-942/CorsMisconfiguration.go

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ func main() {
120120
}
121121
})
122122
http.HandleFunc("/", func(w http.ResponseWriter, req *http.Request) {
123-
// OK-ish: the input origin header is validated agains a whitelist.
123+
// OK-ish: the input origin header is validated against a whitelist.
124124
responseHeader := w.Header()
125125
{
126126
origin := req.Header.Get("origin")
@@ -137,7 +137,7 @@ func main() {
137137
})
138138
http.HandleFunc("/", func(w http.ResponseWriter, req *http.Request) {
139139
originSuffix := ".example.com"
140-
// OK-ish: the input origin header is validated agains a suffix.
140+
// OK-ish: the input origin header is validated against a suffix.
141141
origin := req.Header.Get("Origin")
142142
if origin != "" && (originSuffix == "" || strings.HasSuffix(origin, originSuffix)) {
143143
w.Header().Set("Access-Control-Allow-Origin", origin)
@@ -152,7 +152,7 @@ func main() {
152152
})
153153
http.HandleFunc("/", func(w http.ResponseWriter, req *http.Request) {
154154
originSuffix := ".example.com"
155-
// OK-ish: the input origin header is validated agains a whitelist.
155+
// OK-ish: the input origin header is validated against a whitelist.
156156
origin := req.Header.Get("Origin")
157157
if origin != "" && (originSuffix == "" || AccessControlAllowOrigins[origin]) {
158158
w.Header().Set("Access-Control-Allow-Origin", origin)
@@ -166,7 +166,7 @@ func main() {
166166
}
167167
})
168168
http.HandleFunc("/", func(w http.ResponseWriter, req *http.Request) {
169-
// OK-ish: the input origin header is validated agains a whitelist.
169+
// OK-ish: the input origin header is validated against a whitelist.
170170
origin := req.Header.Get("origin")
171171
if origin != "" && origin != "null" {
172172
if len(AccessControlAllowOrigins) == 0 || AccessControlAllowOrigins[origin] {
@@ -178,7 +178,7 @@ func main() {
178178
}
179179
})
180180
// http.HandleFunc("/", func(w http.ResponseWriter, req *http.Request) {
181-
// // OK-ish: the input origin header is validated agains a whitelist.
181+
// // OK-ish: the input origin header is validated against a whitelist.
182182
// origin := req.Header.Get("origin")
183183
// if origin != "" && origin != "null" {
184184
// if _, ok := AccessControlAllowOrigins[origin]; ok {
@@ -190,7 +190,7 @@ func main() {
190190
// }
191191
// })
192192
http.HandleFunc("/", func(w http.ResponseWriter, req *http.Request) {
193-
// OK-ish: the input origin header is validated agains a whitelist.
193+
// OK-ish: the input origin header is validated against a whitelist.
194194
if origin := req.Header.Get("Origin"); cors[origin] {
195195
w.Header().Set("Access-Control-Allow-Origin", origin)
196196
} else if len(origin) > 0 && cors["*"] {
@@ -202,7 +202,7 @@ func main() {
202202
w.Header().Set("Access-Control-Allow-Credentials", "true")
203203
})
204204
http.HandleFunc("/", func(w http.ResponseWriter, req *http.Request) {
205-
// OK-ish: the input origin header is validated agains a whitelist.
205+
// OK-ish: the input origin header is validated against a whitelist.
206206
origin := req.Header.Get("origin")
207207
for _, v := range GetAllowOrigin() {
208208
if v == origin {

go/ql/test/query-tests/Security/CWE-918/websocket.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ func test() {
9696
http.HandleFunc("/ex5", func(w http.ResponseWriter, r *http.Request) {
9797
untrustedInput := r.Referer()
9898

99-
// good as input is tested againt regex
99+
// good as input is tested against regex
100100
if m, _ := regexp.MatchString("ws://localhost:12345/*", untrustedInput); m {
101101
nhooyr.Dial(context.TODO(), untrustedInput, nil)
102102
}

0 commit comments

Comments
 (0)