Skip to content

Commit 160539e

Browse files
committed
Add comments
1 parent dc731c9 commit 160539e

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

routers/web/repo/githttp.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -429,13 +429,15 @@ func serviceRPC(ctx *context.Context, h *serviceHandler, service string) {
429429
expectedContentType := fmt.Sprintf("application/x-git-%s-request", service)
430430
if ctx.Req.Header.Get("Content-Type") != expectedContentType {
431431
log.Error("Content-Type (%q) doesn't match expected: %q", ctx.Req.Header.Get("Content-Type"), expectedContentType)
432+
// FIXME: why it's 401 if the content type is unexpected?
432433
ctx.Resp.WriteHeader(http.StatusUnauthorized)
433434
return
434435
}
435436

436437
cmd, err := prepareGitCmdWithAllowedService(service)
437438
if err != nil {
438439
log.Error("Failed to prepareGitCmdWithService: %v", err)
440+
// FIXME: why it's 401 if the service type doesn't supported?
439441
ctx.Resp.WriteHeader(http.StatusUnauthorized)
440442
return
441443
}

0 commit comments

Comments
 (0)