xpublish-community / xpublish

Publish Xarray Datasets via a REST API.
https://xpublish.readthedocs.io
Apache License 2.0
167 stars 23 forks source link

Enable HEAD request instead of ony GET #269

Open wachsylon opened 3 months ago

wachsylon commented 3 months ago

Some ZARR-applications use HEAD requests instead of GET requests. Found out that FASTAPI returns "Method not allowed" for HEAD requests where only GET requests are defined. This would enable it by returning the same as the GETs.

jhamman commented 3 months ago

@wachsylon, can you give some examples of what zarr apps need to be making HEAD requests? I'm struggling to see how this aligns with the classic call patterns against HTTP Zarr stores.

wachsylon commented 3 months ago

i was a bit unspecific: I think that this specific app first tries to find out whether there really is sth to GET before it actually gets it.

use HEAD requests instead of GET requests

so rather "in addition" than "instead of GET".

can you give some examples of what zarr apps need to be making HEAD requests?

I needed it for a zarr-js app.

I'm struggling to see how this aligns with the classic call patterns against HTTP Zarr stores.

I thought that we just do not want xpublish to return "method not allowed" for HEADs anyway, no matter what the standard actually is.