From 0dc7424018f91f835b6ed71e076d168065990045 Mon Sep 17 00:00:00 2001 From: wachsylon Date: Thu, 23 May 2024 14:22:41 +0200 Subject: [PATCH] Enable HEAD request instead of ony GET --- xpublish/plugins/included/zarr.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/xpublish/plugins/included/zarr.py b/xpublish/plugins/included/zarr.py index 15f40e5..1e91abb 100644 --- a/xpublish/plugins/included/zarr.py +++ b/xpublish/plugins/included/zarr.py @@ -39,7 +39,7 @@ def dataset_router(self, deps: Dependencies) -> APIRouter: # noqa: D102 tags=list(self.dataset_router_tags), ) - @router.get(f'/{ZARR_METADATA_KEY}') + @router.api_route(f'/{ZARR_METADATA_KEY}',methods=['GET', 'HEAD']) def get_zarr_metadata( dataset=Depends(deps.dataset), cache=Depends(deps.cache), @@ -52,7 +52,7 @@ def get_zarr_metadata( return JSONResponse(zjson) - @router.get(f'/{group_meta_key}') + @router.api_route(f'/{group_meta_key}',methods=['GET', 'HEAD']) def get_zarr_group( dataset=Depends(deps.dataset), cache=Depends(deps.cache), @@ -63,7 +63,7 @@ def get_zarr_group( return JSONResponse(zmetadata['metadata'][group_meta_key]) - @router.get(f'/{attrs_key}') + @router.api_route(f'/{attrs_key}',methods=['GET', 'HEAD']) def get_zarr_attrs( dataset=Depends(deps.dataset), cache=Depends(deps.cache), @@ -74,7 +74,7 @@ def get_zarr_attrs( return JSONResponse(zmetadata['metadata'][attrs_key]) - @router.get('/{var}/{chunk}') + @router.api_route('/{var}/{chunk}',methods=['GET', 'HEAD']) def get_variable_chunk( var: str = Path(description='Variable in dataset'), chunk: str = Path(description='Zarr chunk'),