about summary refs log tree commit diff
path: root/tvix/nar-bridge
diff options
context:
space:
mode:
authorsinavir <tvix@sinavir.fr>2024-09-22T19·28+0200
committersinavir <tvix@sinavir.fr>2024-09-24T09·45+0000
commit0f924001122b41a3f2a239a2f9f9edea9da96c7d (patch)
tree52a194acb66c4cb58fe529324170daee89150075 /tvix/nar-bridge
parentcd0c3a96ab7355f7e6c0309a3088ac185bef9355 (diff)
fix(tvix/nar-bridge): Remove name check for root node in nar generation r/8711
Nar-bridge tried to parse the name of the protobuf node encoded in the
URL into a PathComponent but this name was empty, leading to an error
when the user tried to retrieve the nar file.

This was an oversight from the conversion to stricter types (some of the
CLs in the serious containing cl/12217).

We need a version converting a protobuf without a name to our stricter
types, but an empty PathComponent cannot be constructed.

So we need a into_name_and_node() version that returns the name as
Bytes, not PathComponent.

Change-Id: I2996cdd2e0107133e502748947298f512f1cc521
Reviewed-on: https://cl.tvl.fyi/c/depot/+/12504
Reviewed-by: flokli <flokli@flokli.de>
Tested-by: BuildkiteCI
Diffstat (limited to 'tvix/nar-bridge')
-rw-r--r--tvix/nar-bridge/src/nar.rs2
1 files changed, 1 insertions, 1 deletions
diff --git a/tvix/nar-bridge/src/nar.rs b/tvix/nar-bridge/src/nar.rs
index 70d9d644c26c..2f6c0cc5a0ef 100644
--- a/tvix/nar-bridge/src/nar.rs
+++ b/tvix/nar-bridge/src/nar.rs
@@ -52,7 +52,7 @@ pub async fn get(
             StatusCode::NOT_FOUND
         })?;
 
-    let (root_name, root_node) = root_node.into_name_and_node().map_err(|e| {
+    let (root_name, root_node) = root_node.into_name_bytes_and_node().map_err(|e| {
         warn!(err=%e, "root node validation failed");
         StatusCode::BAD_REQUEST
     })?;