Skip to content

Commit

Permalink
fix: disable cors on /
Browse files Browse the repository at this point in the history
  • Loading branch information
natesales committed Feb 2, 2025
1 parent f60f803 commit bcb3ce5
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion main.go
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,9 @@ func attestationReport(certFP string) (*attestation.Document, error) {
}

func cors(w http.ResponseWriter, r *http.Request) {
w.Header().Del("Access-Control-Allow-Origin")
w.Header().Del("Access-Control-Allow-Methods")
w.Header().Del("Access-Control-Allow-Headers")
w.Header().Set("Access-Control-Allow-Origin", "*")
w.Header().Set("Access-Control-Allow-Methods", "*")
w.Header().Set("Access-Control-Allow-Headers", "*")
Expand Down Expand Up @@ -132,7 +135,7 @@ func main() {
}

mux.HandleFunc("/", func(w http.ResponseWriter, r *http.Request) {
cors(w, r)
// cors(w, r)

if len(paths) > 0 {
allowed := false
Expand Down

0 comments on commit bcb3ce5

Please sign in to comment.