Support ipfs and ipns urls (#667)

Brave browser has native support for ipfs:// and ipns:// urls but this assertion is currently blocking. Updated to support them. Untested.
This commit is contained in:
carumusan
2021-03-04 21:57:53 +01:00
committed by GitHub
parent 253c9bf785
commit 1a6be158f1
@@ -239,7 +239,7 @@ export default class State {
}
private stripUrl (url: string): string {
assert(url && (url.startsWith('http:') || url.startsWith('https:')), `Invalid url ${url}, expected to start with http: or https:`);
assert(url && (url.startsWith('http:') || url.startsWith('https:') || url.startsWith('ipfs:') || url.startsWith('ipns:')), `Invalid url ${url}, expected to start with http: or https: or ipfs: or ipns:`);
const parts = url.split('/');