diff --git a/cmd/changelog-remote/main.go b/cmd/changelog-remote/main.go index 81f4b0bf..5f8e835c 100644 --- a/cmd/changelog-remote/main.go +++ b/cmd/changelog-remote/main.go @@ -70,6 +70,12 @@ func handler(w http.ResponseWriter, r *http.Request) { w.Header().Set("Access-Control-Allow-Origin", r.Header.Get("Origin")) w.Header().Set("Access-Control-Allow-Methods", "GET") + if r.Method == http.MethodOptions { + w.WriteHeader(200) + _, _ = w.Write([]byte{}) + return + } + query := r.URL.Query() username := query.Get("username") diff --git a/repl/src/App.vue b/repl/src/App.vue index a926b584..e1c444f3 100644 --- a/repl/src/App.vue +++ b/repl/src/App.vue @@ -76,7 +76,10 @@ function onSubmit() { form.value.username || "" }&repo=${form.value.repo || ""}&version=${ form.value.version || "" - }&template=${tpl || ""}` + }&template=${tpl || ""}`, + { + mode: "no-cors", + } ) .then((res) => { return res.text();