Repository navigation
Fix non-http prepended urls - #35
Merged
Merged
Conversation
kentcdodds
requested changes
Feb 23, 2017
kentcdodds
left a comment
Member
There was a problem hiding this comment.
Cool! Just a few changes. Thanks!
| @@ -0,0 +1,16 @@ | |||
| #root = true | |||
Member
There was a problem hiding this comment.
Please remove this. I prefer to not have unrelated changes in PRs. Feel free to make another PR if you want to add this.
| name: body.name || username, | ||
| avatar_url: body.avatar_url, | ||
| profile: body.blog || body.html_url | ||
| profile: profile |
Member
There was a problem hiding this comment.
We support Node v4 and above so you can use object shorthand here:
{
// ...
profile
// ...
}
| }); | ||
| }); | ||
|
|
||
| test('should append http when no absolute link is provided', t => { |
Contributor
Author
|
@kentcdodds I've also realized I could use startsWith instead of indexOf :) |
kentcdodds
approved these changes
Feb 23, 2017
Member
|
Thanks a bunch! |
Collaborator
|
Thanks a lot @alexjoverm! 🎉 |
Berkmann18
pushed a commit
that referenced
this pull request
May 24, 2020
* docs: update README.md * docs: update .all-contributorsrc
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
When either
body.blog || body.html_urlare not prepended with http, github itself does it for you. But when those are retrieved from the url, they still come without the http://, causing the link to be broken.See this PR from one of my repos for more info: alexjoverm/typescript-library-starter#7
Additionally, I made this PR from windows and was finding a lot of CLRF issues, so I've added a .editorconfig thus that doesn't happen to other people.