forked from OctoLinker/OctoLinker
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Bypass OctoLinker API for nuget urls (OctoLinker#792)
By default OctoLinker validates external URLs via https://octolinker-api.now.sh/ to ensure the linked URL is valid and reachable. This obviously slows down the startup since OctoLinker needs to wait for the API response. There is a special resolver called `resolver-trusted-url` which allows you to opt-out from this behaviour. This is useful for documenation pages or registry urls where you can ensure the right url.
- Loading branch information
1 parent
49be306
commit 938a971
Showing
4 changed files
with
26 additions
and
14 deletions.
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
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,3 +1,7 @@ | ||
import resolverTrustedUrl from '@octolinker/resolver-trusted-url'; | ||
|
||
export default function({ target }) { | ||
return `https://www.nuget.org/packages/${target}`; | ||
return resolverTrustedUrl({ | ||
target: `https://www.nuget.org/packages/${target}`, | ||
}); | ||
} |
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