Skip to content

Use canonical URL in utils.getRepoURL - #26

Merged
fregante merged 4 commits into
masterfrom
canonical-getRepoURL
Jul 24, 2020
Merged

fregante merged 4 commits into
masterfrom
canonical-getRepoURL

Conversation

@fregante

Copy link
Copy Markdown
Member

This should improve support of aNyCaSe/RePos across the board

@fregante fregante added the bug Something isn't working label Jul 23, 2020
@fregante
fregante marked this pull request as ready for review July 23, 2020 18:20
@fregante

Copy link
Copy Markdown
Member Author

This seems to work everywhere except the Security page. GitHub reports https://github.com/ there.

Also, @busches can you verify that this meta tag exists on every repo page on GHE?

document.querySelector('[property="og:url"]').content

You can create a live expression in the console and just navigate the repo

@busches

busches commented Jul 24, 2020

Copy link
Copy Markdown
Member

@fregante Here ya go:

  • ghe.com/repo/pulls -> ghe.com/repo
  • ghe.com/repo/pull/1 -> ghe.com/repo/pull/1
  • ghe.com/repo/pull/1/commits -> ghe.com/repo/pull/1
  • ghe.com/repo/pull/1files -> ghe.com/repo/pull/1
  • ghe.com/repo/issues -> ghe.com/repo
  • ghe.com/repo/issues/1 -> ghe.com/repo/issues/1
  • ghe.com/pulls -> ghe.com
  • ghe.com/issues -> ghe.com
  • ghe.com/orgName -> ghe.com/orgName
  • ghe.com/orgs/orgName/people -> ghe.com/orgName

This was tested on 2.20. Let me know if you need any other specific test cases.

@fregante

Copy link
Copy Markdown
Member Author

All good, this only has to work on repo pages anyway. Thank you!

@fregante
fregante merged commit 188b80e into master Jul 24, 2020
@fregante
fregante deleted the canonical-getRepoURL branch July 24, 2020 17:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Development

Successfully merging this pull request may close these issues.

2 participants