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 20:57:53 +00:00 committed by GitHub
parent 253c9bf785
commit 1a6be158f1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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('/');