nu met 302 op een git url
5f6382a724d74cf33f45c9091615e5fe4e3400ab
1 files changed
src/GitServer/Controllers/GitController.cs
diff --git a/src/GitServer/Controllers/GitController.cs b/src/GitServer/Controllers/GitController.cs
index 8b351fc..118c529 100644
--- a/src/GitServer/Controllers/GitController.cs
+++ b/src/GitServer/Controllers/GitController.cs
@@ -22,6 +22,11 @@ public class GitController(GitProcessService git, IOptions<GitServerOptions> opt
!string.IsNullOrEmpty(name) &&
System.Text.RegularExpressions.Regex.IsMatch(name, @"^[a-zA-Z0-9_\-\.]+$");
+ [HttpGet("{user}/{repo}.git")]
+ [HttpHead("{user}/{repo}.git")]
+ public IActionResult RedirectBareGitUrl(string user, string repo) =>
+ Redirect($"/{user}/{repo}");
+
[HttpGet("{user}/{repo}.git/info/refs")]
public async Task InfoRefs(string user, string repo, [FromQuery] string? service)
{