From: Eric Wong Date: Mon, 29 Feb 2016 01:05:16 +0000 (+0000) Subject: git-http-backend: stricter parsing of CRLF X-Git-Tag: v1.0.0~675 X-Git-Url: http://www.git.stargrave.org/?a=commitdiff_plain;h=c450d851f8cb466e275097bcc7bf13bfc9365b81;p=public-inbox.git git-http-backend: stricter parsing of CRLF It is not needed as we know git uses CRLF termination. --- diff --git a/lib/PublicInbox/GitHTTPBackend.pm b/lib/PublicInbox/GitHTTPBackend.pm index 6e8ad955..8e6d8b64 100644 --- a/lib/PublicInbox/GitHTTPBackend.pm +++ b/lib/PublicInbox/GitHTTPBackend.pm @@ -201,11 +201,11 @@ sub serve_smart { if ($fh) { # stream body from git-http-backend to HTTP client $fh->write($buf); $buf = ''; - } elsif ($buf =~ s/\A(.*?)\r?\n\r?\n//s) { # parse headers + } elsif ($buf =~ s/\A(.*?)\r\n\r\n//s) { # parse headers my $h = $1; my $code = 200; my @h; - foreach my $l (split(/\r?\n/, $h)) { + foreach my $l (split(/\r\n/, $h)) { my ($k, $v) = split(/:\s*/, $l, 2); if ($k =~ /\AStatus\z/i) { $code = int($v);