@@ -332,21 +332,18 @@ proc initDataApi(node: CodexNodeRef, repoStore: RepoStore, router: var RestRoute
332332 await node.retrieveCid (cid.get (), local = false , resp = resp)
333333
334334 router.api (MethodGet , " /api/codex/v1/data/{infoHash}/network/torrent" ) do (
335- infoHash: BitTorrentInfoHashV1 , resp: HttpResponseRef
335+ infoHash: MultiHash , resp: HttpResponseRef
336336 ) -> RestApiResponse :
337337 var headers = buildCorsHeaders (" GET" , allowedOrigin)
338338
339- without infoHash =? infoHash.tryGet.catch, error:
340- return RestApiResponse .error (Http400 , error.msg, headers = headers)
341-
342- without infoMultiHash =? MultiHash .init ($ Sha1HashCodec , infoHash).mapFailure, error:
339+ without infoHash =? infoHash.mapFailure, error:
343340 return RestApiResponse .error (Http400 , error.msg, headers = headers)
344341
345342 if corsOrigin =? allowedOrigin:
346343 resp.setCorsHeaders (" GET" , corsOrigin)
347344 resp.setHeader (" Access-Control-Headers" , " X-Requested-With" )
348345
349- trace " torrent requested: " , multihash = $ infoMultiHash
346+ trace " torrent requested: " , multihash = $ infoHash
350347
351348 return RestApiResponse .response (Http200 )
352349
0 commit comments