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) { ...@@ -68,16 +68,17 @@ func (s *sendFileResponseWriter) WriteHeader(status int) {
return return
} }
header := s.Header().Get(senddata.Header) if header := s.Header().Get(senddata.Header); header != "" {
s.Header().Del(senddata.Header) s.Header().Del(senddata.Header)
for _, handler := range []senddata.Handler{ for _, handler := range []senddata.Handler{
git.SendBlob, git.SendBlob,
git.SendArchive, git.SendArchive,
} { } {
if handler.Match(header) { if handler.Match(header) {
s.hijacked = true s.hijacked = true
handler.Handle(s.rw, s.req, header) handler.Handle(s.rw, s.req, header)
return 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