Skip to content
Snippets Groups Projects
Commit 60f02b77 authored by gregor herrmann's avatar gregor herrmann
Browse files

Add patch to fix broken custom 'via' handling.

(Patch taken from upstream release 0.304.)

Closes: #788350
parent e81f6dc9
No related branches found
No related tags found
No related merge requests found
From e105876f84220791f2a6b1e64d2a913658c1d269 Mon Sep 17 00:00:00 2001
From: Slaven Rezic <slaven@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} );
hashbang.patch hashbang.patch
spelling.patch spelling.patch
0001-add-port-to-Via-header.patch
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment