Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dnslink fixes #290

Merged
merged 2 commits into from
Oct 10, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion add-on/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"manifest_version": 2,
"name": "IPFS Companion",
"short_name": "IPFS Companion",
"version" : "2.0.12",
"version" : "2.0.13",

"description": "Browser extension that simplifies access to IPFS resources",
"homepage_url": "https://github.com/ipfs/ipfs-companion",
Expand Down
2 changes: 2 additions & 0 deletions add-on/src/lib/common.js
Original file line number Diff line number Diff line change
Expand Up @@ -224,8 +224,10 @@ function isDnslookupPossible () {
}

function isDnslookupSafeForURL (requestUrl) {
// skip URLs that could produce infinite recursion or weird loops
return isDnslookupPossible() &&
requestUrl.startsWith('http') &&
!window.IsIpfs.url(requestUrl) &&
!requestUrl.startsWith(state.apiURLString) &&
!requestUrl.startsWith(state.gwURLString)
}
Expand Down
2 changes: 1 addition & 1 deletion add-on/src/lib/linkifyDOM.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
window.ipfsCompanionLinkifiedDOM = true
window.ipfsCompanionLinkifyValidationCache = new Map()

const urlRE = /(?:\s+|^)(\/ip(?:f|n)s\/|dweb:\/ip(?:f|n)s\/|ipns:\/\/|ipfs:\/\/)([^\s+"<>]+)/g
const urlRE = /(?:\s+|^)(\/ip(?:f|n)s\/|dweb:\/ip(?:f|n)s\/|ipns:\/\/|ipfs:\/\/)([^\s+"<>:]+)/g

// Chrome compatibility
// var browser = browser || chrome
Expand Down