Skip to content

Commit

Permalink
fix(web): superfluous write
Browse files Browse the repository at this point in the history
Fixes: 8c181bc (fix(web): write http prefix before references)
  • Loading branch information
aymanbagabas committed Apr 30, 2024
1 parent 8c181bc commit 6e9db8e
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions pkg/web/git.go
Original file line number Diff line number Diff line change
Expand Up @@ -524,10 +524,6 @@ func getInfoRefs(w http.ResponseWriter, r *http.Request) {
}
}

if version < 2 {
git.WritePktline(w, "# service="+service.String()) // nolint: errcheck
}

if err := service.Handler(ctx, cmd); err != nil {
renderNotFound(w, r)
return
Expand All @@ -536,6 +532,9 @@ func getInfoRefs(w http.ResponseWriter, r *http.Request) {
hdrNocache(w)
w.Header().Set("Content-Type", fmt.Sprintf("application/x-%s-advertisement", service))
w.WriteHeader(http.StatusOK)
if version < 2 {
git.WritePktline(w, "# service="+service.String()) // nolint: errcheck
}
w.Write(refs.Bytes()) // nolint: errcheck
} else {
// Dumb HTTP
Expand Down

0 comments on commit 6e9db8e

Please sign in to comment.