Bug 57960 - PUT truncates response body; status_line appears to be (incorrectly) overridden in dav_error_response
Summary: PUT truncates response body; status_line appears to be (incorrectly) overridd...
Status: NEW
Alias: None
Product: Apache httpd-2
Classification: Unclassified
Component: mod_dav (show other bugs)
Version: 2.4.7
Hardware: PC Mac OS X 10.1
: P2 normal (vote)
Target Milestone: ---
Assignee: Apache HTTPD Bugs Mailing List
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-05-27 22:48 UTC by Johnny Fuery
Modified: 2015-05-27 22:48 UTC (History)
0 users



Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Johnny Fuery 2015-05-27 22:48:38 UTC
Given a successful PUT request in Apache 2.2.22:

curl -u foo:bar -T test.docx https://drive.meruscase.com/test.docx

<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
<html><head>
<title>201 Created</title>
</head><body>
<h1>Created</h1>
<p>Resource /new3.docx has been created.</p>
<hr />
<address>Apache/2.2.22 (Ubuntu) Server at drive.meruscase.com Port 80</address>
</body></html>

--
The same request in 2.4.7:

<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
<html><head>
<title>

Note that this is ONLY the content of the constant "DAV_RESPONSE_BODY_1", without the accompanying content as expected.

--

A current (as of authoring date) review of mod_dav.c indicates this addition on line 317

From [ http://svn.apache.org/viewvc/httpd/httpd/trunk/modules/dav/main/mod_dav.c?revision=1665625&view=markup ]


 r->status_line = ap_get_status_line(status);

...which is subsequently outputted at the point of truncation.

An older revision [ http://svn.apache.org/viewvc/httpd/httpd/trunk/modules/dav/main/mod_dav.c?revision=606693&view=markup ]

...where this issue was not present did not include this add'l line. Interim commits at some points include a comment indicating "not sure if this works, need to test" :-)

Both apache builds were installed on Ubuntu LTS 12.x and 14.x, the respective "blessed" versions that ship with each OS. The issue was reproduced on a "virgin" copy of Ubuntu 14.04 with only mod_dav and mod_dav_fs installed.