Skip to content

Commit

Permalink
Fix name of CORS header
Browse files Browse the repository at this point in the history
  • Loading branch information
fiorix committed Aug 4, 2015
1 parent b625beb commit eafac33
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion cmd/freegeoip/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ func openDB(dsn string, updateIntvl, maxRetryIntvl time.Duration) (db *freegeoip
func CORS(f http.Handler, allow ...string) http.Handler {
return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
w.Header().Set("Access-Control-Allow-Origin", "*")
w.Header().Set("Access-Control-Allow-Method",
w.Header().Set("Access-Control-Allow-Methods",
strings.Join(allow, ", ")+", OPTIONS")
if r.Method == "OPTIONS" {
w.WriteHeader(200)
Expand Down

0 comments on commit eafac33

Please sign in to comment.