feat(tvix/nar-bridge): treat HEAD requests explicitly

We don't need to access castore for HEAD requests.

Change-Id: I9365d9520d5a9e52ed92897d3c4972ec5b6e11fb
Reviewed-on: https://cl.tvl.fyi/c/depot/+/12547
Autosubmit: flokli <flokli@flokli.de>
Reviewed-by: raitobezarius <tvl@lahfa.xyz>
Tested-by: BuildkiteCI
This commit is contained in:
Florian Klink 2024-09-29 21:07:11 +02:00 committed by clbot
parent 2e4a373a04
commit 752f1f82a6
2 changed files with 13 additions and 4 deletions

View file

@ -58,7 +58,8 @@ pub fn gen_router(priority: u64) -> Router<AppState> {
.route("/nar/:nar_str", get(four_o_four))
.route("/nar/:nar_str", head(four_o_four))
.route("/nar/:nar_str", put(nar::put))
.route("/nar/tvix-castore/:root_node_enc", get(nar::get))
.route("/nar/tvix-castore/:root_node_enc", get(nar::get_head))
.route("/nar/tvix-castore/:root_node_enc", head(nar::get_head))
.route("/:narinfo_str", get(narinfo::get))
.route("/:narinfo_str", head(narinfo::head))
.route("/:narinfo_str", put(narinfo::put))