@@ -166,9 +166,15 @@ (define (swh-url path . rest)
(string-append root (string-join rest "/" 'prefix)))
;; Ensure there's a trailing slash or we get a redirect.
- (if (string-suffix? "/" url)
- url
- (string-append url "/")))
+ (cond
+ ((string-suffix? "/" url)
+ url)
+ ;; Special case; don't redirect
+ ;; <https://gitlab.softwareheritage.org/swh/meta/-/issues/5093>
+ ((string-contains url "extid_version")
+ url)
+ (else
+ (string-append url "/"))))
;; XXX: Work around a bug in Guile 3.0.2 where #:verify-certificate? would
;; be ignored (<https://bugs.gnu.org/40486>).
@@ -461,7 +467,9 @@ (define (lookup-external-id type id)
(currently one of: \"bzr-nodeid\", \"hg-nodeid\", \"nar-sha256\",
\"checksum-sha512\")."
(call (swh-url "/api/1/extid" type
- (string-append "hex:" (bytevector->base16-string id)))
+ (string-append "hex:" (bytevector->base16-string id)
+ "/?extid_version=1"
+ ))
json->external-id))
(define* (lookup-directory-by-nar-hash hash #:optional (algorithm 'sha256))