From b392da23633bdb255eed94d4dfd1272f2d132632 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=BE=90=E8=B6=85=E8=B6=8A?= <993921@qq.com> Date: Sun, 17 Mar 2024 11:51:43 +0800 Subject: [PATCH] chore: allow Access-Control-Allow-Origin when health check --- .gitignore | 4 +++- main.go | 4 ++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/.gitignore b/.gitignore index 4cfda1d..e538900 100644 --- a/.gitignore +++ b/.gitignore @@ -3,7 +3,9 @@ runtime/ .env dist/ config.*.toml +config.toml db/geecaptcha.db captcha-bot dict/dec_* -.vscode \ No newline at end of file +.vscode +vendor \ No newline at end of file diff --git a/main.go b/main.go index 00f85bd..79fbaab 100644 --- a/main.go +++ b/main.go @@ -2,14 +2,14 @@ package main import ( "fmt" - "net/http" - "github.com/assimon/captcha-bot/bootstrap" + "net/http" ) func main() { go func() { http.HandleFunc("/healthz", func(w http.ResponseWriter, r *http.Request) { + w.Header().Set("Access-Control-Allow-Origin", "*") fmt.Fprintf(w, "OK") }) http.ListenAndServe(":80", nil)