aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristopher Baines <mail@cbaines.net>2023-05-31 12:57:52 +0100
committerChristopher Baines <mail@cbaines.net>2023-05-31 12:57:52 +0100
commitdac017b56c6867a90374dd58cc7605e13d3575ab (patch)
treed2cf976dddc71880769313354383f3035166afd0
parentb27ca4dc0efbb0d9c397fc39347af9b8e8734ab9 (diff)
downloadnar-herder-dac017b56c6867a90374dd58cc7605e13d3575ab.tar
nar-herder-dac017b56c6867a90374dd58cc7605e13d3575ab.tar.gz
Ensure that nar requests are for the right filename
Rather than just checking the hash.
-rw-r--r--nar-herder/server.scm8
1 files changed, 6 insertions, 2 deletions
diff --git a/nar-herder/server.scm b/nar-herder/server.scm
index 344679d..01de6d8 100644
--- a/nar-herder/server.scm
+++ b/nar-herder/server.scm
@@ -301,8 +301,12 @@
id))))
(narinfo-file-for-compression
(find (lambda (file)
- (string=? (assq-ref file 'compression)
- compression))
+ (and (string=? (assq-ref file 'compression)
+ compression)
+ (string=?
+ (last (string-split (assq-ref file 'url)
+ #\/))
+ (uri-encode filename))))
(or narinfo-files '())))
(compression-symbol
(if (member