Skip Menu |

This queue is for tickets about the mod_perl CPAN distribution.

Report information
The Basics
Id: 119690
Status: resolved
Priority: 0/
Queue: mod_perl

People
Owner: Nobody in particular
Requestors: ntyni [...] iki.fi
Cc:
AdminCc:

Bug Information
Severity: Normal
Broken in: (no value)
Fixed in: (no value)



Subject: [PATCH] Apache 2.4.24+ "strict mode" test failures
From version 2.4.24 onwards, Apache defaults to "strict HTTP mode". See https://httpd.apache.org/docs/2.4/mod/core.html#httpprotocoloptions This makes t/apache/read.t and t/filter/in_bbs_inject_header.t fail with a 400 server error. Proposed patches attached. (This is also <https://bugs.debian.org/849082>, and I sent these patches to dev@perl.apache.org on Dec 25th but they still haven't made it through. Either they were lost or are still stuck in a moderation queue; so retrying here.) -- Niko Tyni ntyni@debian.org
Subject: 380_inject_header_line_terminators.patch
From d59229cf4f5b91ed58e25e27977e76f59096b72d Mon Sep 17 00:00:00 2001 From: Niko Tyni <ntyni@debian.org> Date: Sat, 24 Dec 2016 23:07:28 +0200 Subject: [PATCH 2/2] Fix in_bbs_inject_header line terminators for Apache 2.4.24 compatibility rfc7230 3.5 says: Although the line terminator for the start-line and header fields is the sequence CRLF, a recipient MAY recognize a single LF as a line terminator and ignore any preceding CR. Apache with strict enabled chooses not to implement the MAY. Author: Stefan Fritsch <sf@sfritsch.de> Bug-Debian: https://bugs.debian.org/849082 --- t/filter/TestFilter/in_bbs_inject_header.pm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/t/filter/TestFilter/in_bbs_inject_header.pm b/t/filter/TestFilter/in_bbs_inject_header.pm index b09d6f9..5380c65 100644 --- a/t/filter/TestFilter/in_bbs_inject_header.pm +++ b/t/filter/TestFilter/in_bbs_inject_header.pm @@ -181,7 +181,7 @@ sub handler : FilterConnectionHandler { if ($data and $data =~ /^POST/) { # demonstrate how to add a header while processing other headers - my $header = "$header1_key: $header1_val\n"; + my $header = "$header1_key: $header1_val\r\n"; push @{ $ctx->{buckets} }, APR::Bucket->new($c->bucket_alloc, $header); debug "queued header [$header]"; } @@ -199,7 +199,7 @@ sub handler : FilterConnectionHandler { # we hit the headers and body separator, which is a good # time to add extra headers: for my $key (keys %headers) { - my $header = "$key: $headers{$key}\n"; + my $header = "$key: $headers{$key}\r\n"; push @{ $ctx->{buckets} }, APR::Bucket->new($c->bucket_alloc, $header); debug "queued header [$header]"; } -- 2.11.0
From: ntyni [...] iki.fi
On Wed Jan 04 09:39:20 2017, ntyni@iki.fi wrote: Show quoted text
> From version 2.4.24 onwards, Apache defaults to "strict HTTP mode". > See > https://httpd.apache.org/docs/2.4/mod/core.html#httpprotocoloptions > > This makes t/apache/read.t and t/filter/in_bbs_inject_header.t > fail with a 400 server error. Proposed patches attached.
Um, here's the other one... -- Niko
Subject: 370_http_syntax.patch
From 4a803fdb4c9eae8538293fe31c9222eecb6465be Mon Sep 17 00:00:00 2001 From: Niko Tyni <ntyni@debian.org> Date: Fri, 23 Dec 2016 18:27:23 +0200 Subject: [PATCH 1/2] Fix t/apache/read.t HTTP syntax for Apache 2.4.24 compatibility HTTP/1.1 RFC 7230, section 2.6. "Protocol Versioning" says the HTTP name is case sensitive. Starting with Apache 2.4.24, using lower case will make the server issue a 400 Bad request response, causing a test failure. https://tools.ietf.org/html/rfc7230#section-2.6 Bug-Debian: https://bugs.debian.org/849082 --- t/apache/read.t | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/t/apache/read.t b/t/apache/read.t index 83670c9..9f7f504 100644 --- a/t/apache/read.t +++ b/t/apache/read.t @@ -24,7 +24,7 @@ close $fh; my $size = length $data; -for my $string ("POST $location http/1.0", +for my $string ("POST $location HTTP/1.0", "Content-length: $size", "") { my $line = "$string\r\n"; -- 2.11.0
Subject: Re: [rt.cpan.org #119690] [PATCH] Apache 2.4.24+ "strict mode" test failures
Date: Wed, 4 Jan 2017 14:48:03 +0000
To: bug-mod_perl [...] rt.cpan.org
From: Steve Hay <steve.m.hay [...] googlemail.com>
On 4 January 2017 at 14:40, ntyni@iki.fi via RT <bug-mod_perl@rt.cpan.org> wrote: Show quoted text
> Queue: mod_perl > Ticket <URL: https://rt.cpan.org/Ticket/Display.html?id=119690 > > > On Wed Jan 04 09:39:20 2017, ntyni@iki.fi wrote:
>> From version 2.4.24 onwards, Apache defaults to "strict HTTP mode". >> See >> https://httpd.apache.org/docs/2.4/mod/core.html#httpprotocoloptions >> >> This makes t/apache/read.t and t/filter/in_bbs_inject_header.t >> fail with a 400 server error. Proposed patches attached.
> > Um, here's the other one...
Thanks! Hopefully these have just been dealt with by https://rt.cpan.org/Ticket/Display.html?id=119685 ?
Subject: Re: [rt.cpan.org #119690] [PATCH] Apache 2.4.24+ "strict mode" test failures
Date: Wed, 4 Jan 2017 16:57:59 +0200
To: "steve.m.hay [...] googlemail.com via RT" <bug-mod_perl [...] rt.cpan.org>
From: Niko Tyni <ntyni [...] iki.fi>
On Wed, Jan 04, 2017 at 09:48:27AM -0500, steve.m.hay@googlemail.com via RT wrote: Show quoted text
> <URL: https://rt.cpan.org/Ticket/Display.html?id=119690 > > > On 4 January 2017 at 14:40, ntyni@iki.fi via RT > <bug-mod_perl@rt.cpan.org> wrote:
> > Queue: mod_perl > > Ticket <URL: https://rt.cpan.org/Ticket/Display.html?id=119690 > > > > > On Wed Jan 04 09:39:20 2017, ntyni@iki.fi wrote:
> >> From version 2.4.24 onwards, Apache defaults to "strict HTTP mode". > >> See > >> https://httpd.apache.org/docs/2.4/mod/core.html#httpprotocoloptions > >> > >> This makes t/apache/read.t and t/filter/in_bbs_inject_header.t > >> fail with a 400 server error. Proposed patches attached.
> > > > Um, here's the other one...
> > Thanks! Hopefully these have just been dealt with by > https://rt.cpan.org/Ticket/Display.html?id=119685 ?
Whoops, a duplicate indeed. Thanks, feel free to close this. -- Niko
Closing as agreed.