diff options
author | Aki <please@ignore.pl> | 2023-12-31 04:37:47 +0100 |
---|---|---|
committer | Aki <please@ignore.pl> | 2023-12-31 04:37:47 +0100 |
commit | ef05c6943814d5851cd8a890ecb05cf715cd0bec (patch) | |
tree | d22a8310f66ea952511f3c33658c75a201022f0b | |
parent | 904e0235608d87d7ed447fcb875a6814fe7ed5c2 (diff) | |
download | rudone-ef05c6943814d5851cd8a890ecb05cf715cd0bec.zip rudone-ef05c6943814d5851cd8a890ecb05cf715cd0bec.tar.gz rudone-ef05c6943814d5851cd8a890ecb05cf715cd0bec.tar.bz2 |
Fixed missing OPTIONS that's also allowed
-rw-r--r-- | main.go | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -14,14 +14,14 @@ func handleHome(w http.ResponseWriter, r *http.Request) { func handleEntryOptions(w http.ResponseWriter, r *http.Request) { w.Header().Set("Access-Control-Allow-Origin", "*") - w.Header().Set("Access-Control-Allow-Methods", "POST") + w.Header().Set("Access-Control-Allow-Methods", "POST, OPTIONS") w.Header().Set("Access-Control-Allow-Headers", "Content-Type") w.WriteHeader(http.StatusNoContent) } func handleEntryPost(w http.ResponseWriter, r *http.Request) { w.Header().Set("Access-Control-Allow-Origin", "*") - w.Header().Set("Access-Control-Allow-Methods", "POST") + w.Header().Set("Access-Control-Allow-Methods", "POST, OPTIONS") w.Header().Set("Access-Control-Allow-Headers", "Content-Type") var entry Entry |