refactor: add test ens site

This commit is contained in:
Derrick Hammer 2023-10-16 12:27:49 -04:00
parent 02d281162b
commit d5f245e2c1
Signed by: pcfreak30
GPG Key ID: C997C339BE476FF2
1 changed files with 10 additions and 1 deletions

View File

@ -23,7 +23,16 @@ export default class IPFSProvider implements ContentProvider {
try {
if (ipnsPath(cid)) {
const cidHash = cid.replace("/ipns/", "");
// Use sogola.eth as a test, bypass lookup.
if (
cidHash ===
"k51qzi5uqu5dhxd50115dn1hfvuwiqwej3dki72uyopetqua71i6lp96pem0a6"
) {
cid = "QmbavvC59N5u93LqPR5Kz74wdUY3FWnDv38SvhTx4oQope";
} else {
cid = await this._client.ipns(cidHash);
}
cid = `/ipfs/${cid}`;
}