Skip to content

Commit

Permalink
mint - enable cors
Browse files Browse the repository at this point in the history
  • Loading branch information
elnosh committed Jul 1, 2024
1 parent 31f5235 commit 6145e86
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions mint/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,7 @@ func (ms *MintServer) writeResponse(
slog.String("url", req.URL.String()), slog.Int("code", http.StatusOK)))

rw.Header().Set("Content-Type", "application/json")
rw.Header().Set("Access-Control-Allow-Origin", "*")
rw.Write(response)
}

Expand All @@ -130,6 +131,7 @@ func (ms *MintServer) writeErr(rw http.ResponseWriter, req *http.Request, errRes
slog.String("url", req.URL.String()), slog.Int("code", code)))

rw.Header().Set("Content-Type", "application/json")
rw.Header().Set("Access-Control-Allow-Origin", "*")
rw.WriteHeader(code)
errRes, _ := json.Marshal(errResponse)
rw.Write(errRes)
Expand Down

0 comments on commit 6145e86

Please sign in to comment.