Page MenuHomePhabricator

POST request sent without content-length creates entries in lighttpd's error.log
Open, MediumPublic

Description

For every request, lighttpd/1.4.31 was logging the following to error.log:

2014-06-18 10:13:56: (request.c.1148) POST-request, but content-length missing -> 411

While these POST requests for every page view seem to be caused by bug 66225, it still seems wrong that a POST request is sent but its content-length is missing.

I've come across at least two other projects where this was fixed:

Can this be fixed in MediaWiki as well?

./includes/libs/MultiHttpClient.php does contain:


} elseif ( $req['method'] === 'POST' ) {

        curl_setopt( $ch, CURLOPT_POST, 1 );
        curl_setopt( $ch, CURLOPT_POSTFIELDS, $req['body'] );
} else {
        if ( is_resource( $req['body'] ) || $req['body'] !== '' ) {
                throw new Exception( "HTTP body specified for a non PUT/POST request." );
        }
        $req['headers']['content-length'] = 0;

So, "content-length" is indeed set, but I don't know how to get a call chain to see if this method is really used here.


Version: 1.23.0
Severity: normal

Details

Reference
bz66769

Event Timeline

bzimport raised the priority of this task from to Medium.Nov 22 2014, 3:21 AM
bzimport set Reference to bz66769.
bzimport added a subscriber: Unknown Object (MLST).