|
@ -71,7 +71,19 @@ func checkAuth(timestamp, signature, message string) bool { |
|
|
return false |
|
|
return false |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
func addCorsHeaders(w *http.ResponseWriter, req *http.Request) { |
|
|
|
|
|
(*w).Header().Set("Access-Control-Allow-Origin", "*") |
|
|
|
|
|
(*w).Header().Set("Access-Control-Allow-Methods", "POST, GET, OPTIONS") |
|
|
|
|
|
(*w).Header().Set("Access-Control-Allow-Headers", "Accept, Content-Type, Content-Length, Accept-Encoding, X-CSRF-Token, Authorization") |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
func claimHandler(w http.ResponseWriter, req *http.Request, op string) { |
|
|
func claimHandler(w http.ResponseWriter, req *http.Request, op string) { |
|
|
|
|
|
addCorsHeaders(&w, req) |
|
|
|
|
|
|
|
|
|
|
|
if (*req).Method == "OPTIONS" { |
|
|
|
|
|
return |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
var c Claim |
|
|
var c Claim |
|
|
var resp Result |
|
|
var resp Result |
|
|
if ok := checkRequest(w, req); !ok { |
|
|
if ok := checkRequest(w, req); !ok { |
|
|