diff options
author | Till Faelligen <2353100+S7evinK@users.noreply.github.com> | 2024-11-14 13:42:51 +0100 |
---|---|---|
committer | Till Faelligen <2353100+S7evinK@users.noreply.github.com> | 2024-11-14 13:42:51 +0100 |
commit | 79b87c7a08045a5b5c676b97cedd49250bff2237 (patch) | |
tree | d0716b0d3bcb85be2a05534bf1cab0597136b168 /internal | |
parent | 488009ca905be78c0cbd5364e879d61232b32868 (diff) | |
parent | 6cd1285ca0276bebd407110c37031bc4622f0b79 (diff) |
Diffstat (limited to 'internal')
-rw-r--r-- | internal/httputil/httpapi.go | 6 | ||||
-rw-r--r-- | internal/version.go | 2 |
2 files changed, 7 insertions, 1 deletions
diff --git a/internal/httputil/httpapi.go b/internal/httputil/httpapi.go index 0559fbb7..034f19f1 100644 --- a/internal/httputil/httpapi.go +++ b/internal/httputil/httpapi.go @@ -210,6 +210,12 @@ func MakeExternalAPI(metricsName string, f func(*http.Request) util.JSONResponse // This is used to serve HTML alongside JSON error messages func MakeHTTPAPI(metricsName string, userAPI userapi.QueryAcccessTokenAPI, enableMetrics bool, f func(http.ResponseWriter, *http.Request), checks ...AuthAPIOption) http.Handler { withSpan := func(w http.ResponseWriter, req *http.Request) { + if req.Method == http.MethodOptions { + util.SetCORSHeaders(w) + w.WriteHeader(http.StatusOK) // Maybe http.StatusNoContent? + return + } + trace, ctx := internal.StartTask(req.Context(), metricsName) defer trace.EndTask() req = req.WithContext(ctx) diff --git a/internal/version.go b/internal/version.go index 8616b82a..e5ff5af8 100644 --- a/internal/version.go +++ b/internal/version.go @@ -18,7 +18,7 @@ var build string const ( VersionMajor = 0 VersionMinor = 13 - VersionPatch = 7 + VersionPatch = 8 VersionTag = "" // example: "rc1" gitRevLen = 7 // 7 matches the displayed characters on github.com |