Skip to content

Commit 9a92e23

Browse files
committed
address comments
Signed-off-by: Ben Ye <[email protected]>
1 parent 3bfd96f commit 9a92e23

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

pkg/api/query/v1.go

+4-1
Original file line numberDiff line numberDiff line change
@@ -427,7 +427,6 @@ func (qapi *QueryAPI) labelValues(r *http.Request) (interface{}, []error, *api.A
427427
if err != nil {
428428
return nil, nil, &api.ApiError{Typ: api.ErrorBadData, Err: err}
429429
}
430-
// Prometheus doesn't check this, do we need to?
431430
if end.Before(start) {
432431
err := errors.New("end timestamp must not be before start time")
433432
return nil, nil, &api.ApiError{Typ: api.ErrorBadData, Err: err}
@@ -481,6 +480,10 @@ func (qapi *QueryAPI) series(r *http.Request) (interface{}, []error, *api.ApiErr
481480
if err != nil {
482481
return nil, nil, &api.ApiError{Typ: api.ErrorBadData, Err: err}
483482
}
483+
if end.Before(start) {
484+
err := errors.New("end timestamp must not be before start time")
485+
return nil, nil, &api.ApiError{Typ: api.ErrorBadData, Err: err}
486+
}
484487

485488
var matcherSets [][]*labels.Matcher
486489
for _, s := range r.Form["match[]"] {

0 commit comments

Comments
 (0)