Commit 2788c575 authored by Jacob Vosmaer's avatar Jacob Vosmaer

Skip empty send-data header quicker

parent ec168f4b
......@@ -68,16 +68,17 @@ func (s *sendFileResponseWriter) WriteHeader(status int) {
return
}
header := s.Header().Get(senddata.Header)
s.Header().Del(senddata.Header)
for _, handler := range []senddata.Handler{
git.SendBlob,
git.SendArchive,
} {
if handler.Match(header) {
s.hijacked = true
handler.Handle(s.rw, s.req, header)
return
if header := s.Header().Get(senddata.Header); header != "" {
s.Header().Del(senddata.Header)
for _, handler := range []senddata.Handler{
git.SendBlob,
git.SendArchive,
} {
if handler.Match(header) {
s.hijacked = true
handler.Handle(s.rw, s.req, header)
return
}
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment