Skip to content

Commit

Permalink
metric: report query errors
Browse files Browse the repository at this point in the history
Signed-off-by: He Xian <[email protected]>
  • Loading branch information
hexian000 committed Jun 18, 2024
1 parent 48a4b19 commit e671245
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion v2/metric.go
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,12 @@ func (h *apiStatsHandler) ServeHTTP(w http.ResponseWriter, r *http.Request) {
slog.Debugf("uri: %s", formats.Error(err))
return
}
query := uri.Query()
query, err := url.ParseQuery(uri.RawQuery)
if err != nil {
w.WriteHeader(http.StatusBadRequest)
slog.Debugf("uri: %s", formats.Error(err))
return
}
rt := false
if s := query.Get("runtime"); s != "" {
if b, err := strconv.ParseBool(s); err == nil {
Expand Down

0 comments on commit e671245

Please sign in to comment.