summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAki <please@ignore.pl>2023-12-31 04:37:47 +0100
committerAki <please@ignore.pl>2023-12-31 04:37:47 +0100
commitef05c6943814d5851cd8a890ecb05cf715cd0bec (patch)
treed22a8310f66ea952511f3c33658c75a201022f0b
parent904e0235608d87d7ed447fcb875a6814fe7ed5c2 (diff)
downloadrudone-ef05c6943814d5851cd8a890ecb05cf715cd0bec.zip
rudone-ef05c6943814d5851cd8a890ecb05cf715cd0bec.tar.gz
rudone-ef05c6943814d5851cd8a890ecb05cf715cd0bec.tar.bz2
Fixed missing OPTIONS that's also allowed
-rw-r--r--main.go4
1 files changed, 2 insertions, 2 deletions
diff --git a/main.go b/main.go
index 991c54a..f2cb460 100644
--- a/main.go
+++ b/main.go
@@ -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