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 1/2] 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 From 2b0f7f2e5341ff99d819c632fa38d22ee0672bab Mon Sep 17 00:00:00 2001 From: maliming Date: Wed, 24 Apr 2019 15:16:36 +0800 Subject: [PATCH 2/2] Update GithubDocumentStore.cs --- .../Volo/Docs/GitHub/Documents/GithubDocumentStore.cs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) 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 b6bd194329..2d65a17c68 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,8 @@ namespace Volo.Docs.GitHub.Documents { return rootUrl .Replace("github.com", "raw.githubusercontent.com") - .ReplaceFirst("/tree/", "/").EnsureEndsWith('/'); + .ReplaceFirst("/tree/", "/") + .EnsureEndsWith('/'); } } -} \ No newline at end of file +}