-
Notifications
You must be signed in to change notification settings - Fork 23
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
feat: support subdomains in isIPFS.url(url) #32
Merged
Merged
Changes from all commits
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
cc40cd4
feat: support DNSLink subdomains
lidel 2644db0
test: support peer multiaddr with /p2p/
lidel 72c0344
fix: explicitly ignore URL param and hash
lidel f1823cc
refactor: simplify dnslinkSubdomain
lidel c520efc
fix: url() check should include subdomain()
lidel d9e7082
refactor: merge DNSLink check into ipnsSubdomain()
lidel d5717e9
docs: update examples
lidel 87d746a
refactor: switch to iso-url
lidel 404957e
refactor: lint-package-json
lidel 18d80d4
chore: update deps
lidel File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -38,3 +38,4 @@ node_modules | |
|
||
dist | ||
lib | ||
docs |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,55 +1,67 @@ | ||
{ | ||
"name": "is-ipfs", | ||
"version": "0.6.3", | ||
"description": "A set of utilities to help identify IPFS resources", | ||
"description": "A set of utilities to help identify IPFS resources on the web", | ||
"keywords": [ | ||
"js-ipfs", | ||
"ipns", | ||
"gateway", | ||
"dnslink", | ||
"ipfs" | ||
], | ||
"homepage": "https://github.com/ipfs/is-ipfs", | ||
"bugs": { | ||
"url": "https://github.com/ipfs/is-ipfs/issues" | ||
}, | ||
"license": "MIT", | ||
"author": "Francisco Dias <[email protected]> (http://franciscodias.net/)", | ||
"leadMaintainer": "Marcin Rataj <[email protected]>", | ||
"files": [ | ||
"src", | ||
"dist" | ||
], | ||
"main": "src/index.js", | ||
"browser": { | ||
"fs": false | ||
}, | ||
"repository": { | ||
"type": "git", | ||
"url": "https://github.com/ipfs/is-ipfs.git" | ||
}, | ||
"scripts": { | ||
"test:node": "aegir test --target node", | ||
"test:browser": "aegir test --target browser", | ||
"test": "aegir test", | ||
"lint": "aegir lint", | ||
"lint": "aegir lint && aegir lint-package-json", | ||
"release": "aegir release", | ||
"release-minor": "aegir release --type minor", | ||
"release-major": "aegir release --type major", | ||
"build": "aegir build", | ||
"coverage": "aegir coverage", | ||
"coverage-publish": "aegir coverage --upload" | ||
}, | ||
"pre-commit": [ | ||
"test", | ||
"lint" | ||
], | ||
"keywords": [ | ||
"js-ipfs", | ||
"ipfs" | ||
], | ||
"author": "Francisco Dias <[email protected]> (http://franciscodias.net/)", | ||
"license": "MIT", | ||
"dependencies": { | ||
"bs58": "^4.0.1", | ||
"cids": "~0.7.0", | ||
"mafmt": "^7.0.0", | ||
"multiaddr": "^7.2.1", | ||
"multibase": "~0.6.0", | ||
"multihashes": "~0.4.13" | ||
"cids": "~0.8.0", | ||
"iso-url": "~0.4.7", | ||
"mafmt": "^7.1.0", | ||
"multiaddr": "^7.4.3", | ||
"multibase": "~0.7.0", | ||
"multihashes": "~0.4.19" | ||
}, | ||
"devDependencies": { | ||
"aegir": "^20.5.0", | ||
"aegir": "^21.4.5", | ||
"chai": "^4.2.0", | ||
"pre-commit": "^1.2.2" | ||
}, | ||
"repository": { | ||
"type": "git", | ||
"url": "https://github.com/ipfs/is-ipfs.git" | ||
}, | ||
"bugs": { | ||
"url": "https://github.com/ipfs/is-ipfs/issues" | ||
"engines": { | ||
"node": ">=10.0.0", | ||
"npm": ">=6.0.0" | ||
}, | ||
"homepage": "https://github.com/ipfs/is-ipfs", | ||
"pre-commit": [ | ||
"test", | ||
"lint" | ||
], | ||
"contributors": [ | ||
"Alan Shaw <[email protected]>", | ||
"David Dias <[email protected]>", | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does it check for a case insensitive encoding or is this actually just base32?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Web browsers force-lowercase hostname in URL and is-ipfs does the same before we check if CID in subdomain is valid:
https://github.com/ipfs/is-ipfs/blob/f1823cc0b12e97ac1f202ba7c06663b5b9b5d265/src/index.js#L83-L87