Skip to content

Commit 13a38fa

Browse files
committed
fix: AutoIndex must sort directory first then file (#11)
1 parent 7ba8f03 commit 13a38fa

2 files changed

Lines changed: 2 additions & 2 deletions

File tree

src/SimpleW/SimpleW/SimpleWSSession.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ protected override void OnReceivedRequest(HttpRequest request) {
8383
<h1>Index of {requestRoute.Url.AbsolutePath}</h1>
8484
<hr /><pre>"
8585
+(hasParent ? @$"<a href=""../"">../</a>{Environment.NewLine}" : "")
86-
+$"{string.Join(Environment.NewLine, files.OrderBy(f => f).Select(f => $"<a href=\"{f}\">{f}</a>"))}"
86+
+$"{string.Join(Environment.NewLine, files.Select(f => $"<a href=\"{f}\">{f}</a>"))}"
8787
+@"</pre><hr />
8888
</body>
8989
</html>";

src/SimpleW/SimpleW/SimpleWSession.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ protected override void OnReceivedRequest(HttpRequest request) {
8383
<h1>Index of {requestRoute.Url.AbsolutePath}</h1>
8484
<hr /><pre>"
8585
+(hasParent ? @$"<a href=""../"">../</a>{Environment.NewLine}" : "")
86-
+$"{string.Join(Environment.NewLine, files.OrderBy(f => f).Select(f => $"<a href=\"{f}\">{f}</a>"))}"
86+
+$"{string.Join(Environment.NewLine, files.Select(f => $"<a href=\"{f}\">{f}</a>"))}"
8787
+@"</pre><hr />
8888
</body>
8989
</html>";

0 commit comments

Comments
 (0)