Skip to content

Commit

Permalink
fix(dnslink): skip URLs that could produce infinite recursion
Browse files Browse the repository at this point in the history
More details:
#286 (comment)
  • Loading branch information
lidel committed Oct 10, 2017
1 parent b4384fe commit 9eda0bf
Showing 1 changed file with 2 additions and 0 deletions.
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

0 comments on commit 9eda0bf

Please sign in to comment.