mirror of
https://github.com/oceanprotocol-archive/squid-js.git
synced 2024-02-02 15:31:51 +01:00
return file urls
This commit is contained in:
parent
c68b882986
commit
81a282af28
@ -233,15 +233,8 @@ export default class Ocean {
|
|||||||
let url: string = serviceUrl + `?url=${cUrl}`
|
let url: string = serviceUrl + `?url=${cUrl}`
|
||||||
url = url + `&serviceAgreementId=${serviceAgreementId}`
|
url = url + `&serviceAgreementId=${serviceAgreementId}`
|
||||||
url = url + `&consumerAddress=${consumer.getId()}`
|
url = url + `&consumerAddress=${consumer.getId()}`
|
||||||
Logger.log("Fetching asset from: ", url)
|
files.push(url)
|
||||||
const response: any = await webConnector.get(url)
|
|
||||||
const responseBuffer: Buffer = await response.buffer()
|
|
||||||
const urlParts: string[] = cUrl.split("/")
|
|
||||||
const filename: string = urlParts[urlParts.length - 1]
|
|
||||||
Logger.debug(`Got response: filename is ${filename}, url is ${response.url}`)
|
|
||||||
files.push(responseBuffer.toString("utf8"))
|
|
||||||
}
|
}
|
||||||
Logger.log("Done downloading asset files.")
|
|
||||||
|
|
||||||
cb(files)
|
cb(files)
|
||||||
})
|
})
|
||||||
|
Loading…
Reference in New Issue
Block a user