Apache 2.4.24 doesn't send Content-Length: 0 headers for 204 No Content responses

...and is more strict parsing HTTP. Let tests pass on both old and new
versions.
This commit is contained in:
Florian Schlichting 2017-01-01 16:19:07 +01:00
parent c305bef787
commit e565cc0a5e
14 changed files with 9 additions and 13 deletions

View File

@ -6,6 +6,7 @@
#
use strict;
my $no_content = 0;
while( <STDIN> ) {
@ -47,5 +48,12 @@ while( <STDIN> ) {
# Fix up any opaquelocktokens to something regular
s/opaquelocktoken:[[:xdigit:]]{8}-([[:xdigit:]]{4}-){3}[[:xdigit:]]{12}/opaquelocktoken:xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/;
/^HTTP\/1\.1 204 No Content/ && do {
$no_content = 1;
};
/^Content-Length: 0/ && $no_content && do {
$_ = "";
};
print;
}

View File

@ -3,7 +3,6 @@ Date: Dow, 01 Jan 2000 00:00:00 GMT
DAV: 1, 2, 3, access-control, calendar-access, calendar-schedule
DAV: extended-mkcol, bind, addressbook, calendar-auto-schedule, calendar-proxy
ETag: "6cff373f55c3e8318ad1c0db93205d08"
Content-Length: 0
Content-Type: text/plain; charset="utf-8"

View File

@ -3,6 +3,5 @@ Date: Dow, 01 Jan 2000 00:00:00 GMT
DAV: 1, 2, 3, access-control, calendar-access, calendar-schedule
DAV: extended-mkcol, bind, addressbook, calendar-auto-schedule, calendar-proxy
ETag: "2c32a2f8aba853654eb17fe037a4db4d"
Content-Length: 0
Content-Type: text/plain; charset="utf-8"

View File

@ -2,7 +2,6 @@ HTTP/1.1 204 No Content
Date: Dow, 01 Jan 2000 00:00:00 GMT
DAV: 1, 2, 3, access-control, calendar-access, calendar-schedule
DAV: extended-mkcol, bind, addressbook, calendar-auto-schedule, calendar-proxy
Content-Length: 0
Content-Type: text/plain; charset="utf-8"

View File

@ -2,7 +2,6 @@ HTTP/1.1 204 No Content
Date: Dow, 01 Jan 2000 00:00:00 GMT
DAV: 1, 2, 3, access-control, calendar-access, calendar-schedule
DAV: extended-mkcol, bind, addressbook, calendar-auto-schedule, calendar-proxy
Content-Length: 0
Content-Type: text/plain; charset="utf-8"

View File

@ -2,7 +2,7 @@
# PUT a recurring event that we can check we can/can't see at appropriate dates
#
TYPE=PUT
URL=http://regression.host/caldav.php/user1/home/4aaf8f37-f232-4c8e-a72e-e171d4c4fe54.ics HTTP/1.1
URL=http://regression.host/caldav.php/user1/home/4aaf8f37-f232-4c8e-a72e-e171d4c4fe54.ics
HEADER=User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9a1) Gecko/20101108 Calendar/0.4a1
HEADER=Accept: text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5
HEADER=Accept-Language: en-us,en;q=0.5

View File

@ -2,7 +2,6 @@ HTTP/1.1 204 No Content
Date: Dow, 01 Jan 2000 00:00:00 GMT
DAV: 1, 2, 3, access-control, calendar-access, calendar-schedule
DAV: extended-mkcol, bind, addressbook, calendar-auto-schedule, calendar-proxy
Content-Length: 0
Content-Type: text/plain; charset="utf-8"

View File

@ -3,7 +3,6 @@ Date: Dow, 01 Jan 2000 00:00:00 GMT
DAV: 1, 2, 3, access-control, calendar-access, calendar-schedule
DAV: extended-mkcol, bind, addressbook, calendar-auto-schedule, calendar-proxy
ETag: "efd0257efbc898d059c200d1391af060"
Content-Length: 0
Content-Type: text/plain; charset="utf-8"

View File

@ -3,7 +3,6 @@ Date: Dow, 01 Jan 2000 00:00:00 GMT
DAV: 1, 2, 3, access-control, calendar-access, calendar-schedule
DAV: extended-mkcol, bind, addressbook, calendar-auto-schedule, calendar-proxy
ETag: "6079c141bc189326bf2432a8426c4242"
Content-Length: 0
Content-Type: text/plain; charset="utf-8"

View File

@ -2,7 +2,6 @@ HTTP/1.1 204 No Content
Date: Dow, 01 Jan 2000 00:00:00 GMT
DAV: 1, 2, 3, access-control, calendar-access, calendar-schedule
DAV: extended-mkcol, bind, addressbook, calendar-auto-schedule, calendar-proxy
Content-Length: 0
Content-Type: text/plain; charset="utf-8"

View File

@ -2,6 +2,5 @@ HTTP/1.1 204 No Content
Date: Dow, 01 Jan 2000 00:00:00 GMT
DAV: 1, 2, 3, access-control, calendar-access, calendar-schedule
DAV: extended-mkcol, bind, addressbook, calendar-auto-schedule, calendar-proxy
Content-Length: 0
Content-Type: text/plain; charset="utf-8"

View File

@ -2,6 +2,5 @@ HTTP/1.1 204 No Content
Date: Dow, 01 Jan 2000 00:00:00 GMT
DAV: 1, 2, 3, access-control, calendar-access, calendar-schedule
DAV: extended-mkcol, bind, addressbook, calendar-auto-schedule, calendar-proxy
Content-Length: 0
Content-Type: text/plain; charset="utf-8"

View File

@ -2,6 +2,5 @@ HTTP/1.1 204 No Content
Date: Dow, 01 Jan 2000 00:00:00 GMT
DAV: 1, 2, 3, access-control, calendar-access, calendar-schedule
DAV: extended-mkcol, bind, addressbook, calendar-auto-schedule, calendar-proxy
Content-Length: 0
Content-Type: text/plain; charset="utf-8"

View File

@ -2,7 +2,6 @@ HTTP/1.1 204 No Content
Date: Dow, 01 Jan 2000 00:00:00 GMT
DAV: 1, 2, 3, access-control, calendar-access, calendar-schedule
DAV: extended-mkcol, bind, addressbook, calendar-auto-schedule, calendar-proxy
Content-Length: 0
Content-Type: text/plain; charset="utf-8"