mirror of
https://github.com/Tilo-K/ddragon-cdn.git
synced 2026-01-09 16:41:01 +00:00
Some cleanup
This commit is contained in:
9
util.go
9
util.go
@@ -2,6 +2,7 @@ package main
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"net/http"
|
||||
"os"
|
||||
"time"
|
||||
)
|
||||
@@ -16,3 +17,11 @@ func checkError(err error) {
|
||||
v, _ := time.Now().UTC().MarshalText()
|
||||
f.WriteString(fmt.Sprintf("[%s] %s\n", string(v), err))
|
||||
}
|
||||
|
||||
func cors(fs http.Handler) http.HandlerFunc {
|
||||
return func(w http.ResponseWriter, r *http.Request) {
|
||||
(w).Header().Set("Access-Control-Allow-Origin", "*")
|
||||
|
||||
fs.ServeHTTP(w, r)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user