[Pkg-ocaml-maint-commits] [approx] 02/12: Bug#818633: approx: fails to connect to HTTP/2 servers

Eric Cooper ecc at cmu.edu
Thu Nov 24 18:04:17 UTC 2016


This is an automated email from the git hooks/post-receive script.

ecc-guest pushed a commit to branch master
in repository approx.

commit 681e1dde6e832095e700e02e4ebac7a564449855
Author: Romain Francoise <rfrancoise at debian.org>
Date:   Fri Mar 18 23:36:19 2016 +0100

    Bug#818633: approx: fails to connect to HTTP/2 servers
    
    Package: approx
    Version: 5.5-2
    Severity: normal
    
    The dl.google.com server (which serves Debian packages of Google Chrome)
    supports HTTP/2 and replies to the initial HTTP request with a status of
    "HTTP/2.0 200", which omits the traditional reason phrase "OK". This
    trips a regular expression in approx and results in the following error:
    
     Mar 18 22:19:58 iota approx[7811]: Unrecognized response: HTTP/2.0 200
     Mar 18 22:19:58 iota approx[7811]: Unexpected status code: 0
    
    The reason phrase is captured in a group (to reuse 'with_pair', I
    assume) but never actually used so it can be made optional, which is
    what the following trivial patch does:
---
 approx.ml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/approx.ml b/approx.ml
index acc7d7c..6e42552 100644
--- a/approx.ml
+++ b/approx.ml
@@ -272,7 +272,7 @@ let with_pair rex str proc =
   | [| a; b |] -> proc (a, b)
   | _ -> assert false
 
-let status_re = Pcre.regexp "^HTTP/\\d+\\.\\d+\\s+(\\d{3})\\s+(.*?)\\s*$"
+let status_re = Pcre.regexp "^HTTP/\\d+\\.\\d+\\s+(\\d{3})(?:\\s+(.*?)\\s*)?$"
 let header_re = Pcre.regexp "^(.*?):\\s*(.*?)\\s*$"
 
 let process_header resp str =

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-ocaml-maint/packages/approx.git



More information about the Pkg-ocaml-maint-commits mailing list