Skip to content

Commit

Permalink
Enable HEAD request instead of ony GET
Browse files Browse the repository at this point in the history
  • Loading branch information
wachsylon authored May 23, 2024
1 parent 169e326 commit 0dc7424
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions xpublish/plugins/included/zarr.py
Original file line number Diff line number Diff line change
Expand Up @@ -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),
Expand All @@ -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),
Expand All @@ -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),
Expand All @@ -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'),
Expand Down

0 comments on commit 0dc7424

Please sign in to comment.