@@ -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 {
0 commit comments