From 69abc246e60909a41cc885cf3a371042dc98515f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=A8=E6=B6=9B?= Date: Wed, 24 Apr 2019 15:03:40 +0800 Subject: [PATCH] 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. --- .../Volo/Docs/GitHub/Documents/GithubDocumentStore.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/docs/src/Volo.Docs.Domain/Volo/Docs/GitHub/Documents/GithubDocumentStore.cs b/modules/docs/src/Volo.Docs.Domain/Volo/Docs/GitHub/Documents/GithubDocumentStore.cs index 715306ae5c..b6bd194329 100644 --- a/modules/docs/src/Volo.Docs.Domain/Volo/Docs/GitHub/Documents/GithubDocumentStore.cs +++ b/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('/'); } } } \ No newline at end of file