Skip to content
This repository was archived by the owner on Apr 16, 2020. It is now read-only.

GitHub repo url with a trailing slash brakes source linking URLs #232

Closed
SeanFeldman opened this issue Aug 15, 2017 · 1 comment
Closed

Comments

@SeanFeldman
Copy link
Contributor

A GitHub repository URL is assumed to have

  • either no trailing slash
  • or .git at the end

GitHub also allows repo URL to contain a trailing slash (example: https://github.com/owners/repo/).
When such a url is encountered, SourceLink is generating an incorrect document path having two trailing slashes in front of the commit hash.

image

Double slash in the repo URL causes HTTP request to fail with 404 error.

image

Potential fix for this issue would be to ensure repo URL doesn't end with a trailing slash when UrlConverter is executed, similar to .git removal logic.

@SeanFeldman
Copy link
Contributor Author

I can send a PR, but not sure why the tests here are disabled.

SeanFeldman added a commit to SeanFeldman/SourceLink that referenced this issue Aug 15, 2017
@SeanFeldman SeanFeldman changed the title GitHub repo url could have a trailing slash GitHub repo url with a trailing slash brakes source linking URLs Aug 15, 2017
SeanFeldman added a commit to SeanFeldman/SourceLink that referenced this issue Aug 22, 2017
SeanFeldman added a commit to SeanFeldman/SourceLink that referenced this issue Aug 31, 2017
SeanFeldman added a commit to SeanFeldman/SourceLink that referenced this issue Sep 12, 2017
ctaggart pushed a commit that referenced this issue Sep 13, 2017
* fixes #232

* additional test case

* Updated BitBucket URL converter as well

* merged rebase conflict

* fixing implementations

* Today's special: test one one cover another for the same price
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant