Errors when GETting metrics without the feature gate

This commit is contained in:
Louis Dureuil 2023-06-22 23:14:01 +02:00
parent 6196a53668
commit cca6e47ec1
No known key found for this signature in database
3 changed files with 4 additions and 6 deletions

View file

@ -19,6 +19,7 @@ pub async fn get_metrics(
index_scheduler: GuardedData<ActionPolicy<{ actions::METRICS_GET }>, Data<IndexScheduler>>,
auth_controller: Data<AuthController>,
) -> Result<HttpResponse, ResponseError> {
index_scheduler.features()?.check_metrics()?;
let auth_filters = index_scheduler.filters();
if !auth_filters.all_indexes_authorized() {
let mut error = ResponseError::from(AuthenticationError::InvalidToken);