[libhttp-proxy-perl] 01/02: Add patch to fix broken custom 'via' handling.

gregor herrmann gregoa at debian.org
Fri May 19 14:17:18 UTC 2017


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

gregoa pushed a commit to branch jessie
in repository libhttp-proxy-perl.

commit 60f02b77031754872d0823543302255350d0754b
Author: gregor herrmann <gregoa at debian.org>
Date:   Fri Jun 12 13:38:36 2015 +0200

    Add patch to fix broken custom 'via' handling.
    
    (Patch taken from upstream release 0.304.)
    
    Closes: #788350
---
 debian/patches/0001-add-port-to-Via-header.patch | 38 ++++++++++++++++++++++++
 debian/patches/series                            |  1 +
 2 files changed, 39 insertions(+)

diff --git a/debian/patches/0001-add-port-to-Via-header.patch b/debian/patches/0001-add-port-to-Via-header.patch
new file mode 100644
index 0000000..7e26423
--- /dev/null
+++ b/debian/patches/0001-add-port-to-Via-header.patch
@@ -0,0 +1,38 @@
+From e105876f84220791f2a6b1e64d2a913658c1d269 Mon Sep 17 00:00:00 2001
+From: Slaven Rezic <slaven at rezic.de>
+Date: Fri, 12 Nov 2010 11:37:59 +0100
+Subject: [PATCH] add port to Via header
+
+RFC 2616 kind of suggests to add the port to the Via header if it's not
+the default port:
+
+    "If the port is not given, it MAY be assumed to be the default port
+    of the received-protocol."
+
+This patch sets the port in the generated Via header if it's not the
+default 80.
+---
+ lib/HTTP/Proxy.pm | 5 ++++-
+ 1 file changed, 4 insertions(+), 1 deletion(-)
+
+--- a/lib/HTTP/Proxy.pm
++++ b/lib/HTTP/Proxy.pm
+@@ -91,7 +91,6 @@
+         port     => 8080,
+         stash    => {},
+         timeout  => 60,
+-        via      => hostname() . " (HTTP::Proxy/$VERSION)",
+         x_forwarded_for => 1,
+     );
+ 
+@@ -117,6 +116,10 @@
+     $self->{$_} = exists $params{$_} ? delete( $params{$_} ) : $defaults{$_}
+       for keys %defaults;
+ 
++    if (!defined $self->{via}) {
++	$self->{via} = hostname() . ($self->{port} != 80 ? ':' . $self->{port} : '') . " (HTTP::Proxy/$VERSION)";
++    }
++
+     # choose an engine with the remaining parameters
+     $self->{engine} = HTTP::Proxy::Engine->new( %params, proxy => $self );
+     $self->log( PROXY, "PROXY", "Selected engine " . ref $self->{engine} );
diff --git a/debian/patches/series b/debian/patches/series
index 55d236c..b990146 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -1,2 +1,3 @@
 hashbang.patch
 spelling.patch
+0001-add-port-to-Via-header.patch

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-perl/packages/libhttp-proxy-perl.git



More information about the Pkg-perl-cvs-commits mailing list