Browse Source

Ensure GitHub root url ends with forward slash in docs module

If user forgot to put a forward slash at the end of github repo's root url (it's common for urls copied from the web browser's address bar), the code "rawRootUrl + documentName" will return an invalid url path.
pull/1040/head
杨涛 7 years ago
parent
commit
69abc246e6
  1. 2
      modules/docs/src/Volo.Docs.Domain/Volo/Docs/GitHub/Documents/GithubDocumentStore.cs

2
modules/docs/src/Volo.Docs.Domain/Volo/Docs/GitHub/Documents/GithubDocumentStore.cs

@ -206,7 +206,7 @@ namespace Volo.Docs.GitHub.Documents
{
return rootUrl
.Replace("github.com", "raw.githubusercontent.com")
.ReplaceFirst("/tree/", "/");
.ReplaceFirst("/tree/", "/").EnsureEndsWith('/');
}
}
}
Loading…
Cancel
Save