aboutsummaryrefslogtreecommitdiff
path: root/internal
diff options
context:
space:
mode:
Diffstat (limited to 'internal')
-rw-r--r--internal/httputil/httpapi.go6
-rw-r--r--internal/version.go2
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