On Mon, Jan 20, 2014 at 5:21 PM, Eric Covener <cove...@gmail.com> wrote:
> On Mon, Jan 20, 2014 at 5:31 AM, Kalyana sundaram <kalyan...@gmail.com> > wrote: > > > > Hi > > I am using httpd-2.2.26. Whenever I use LimitRequestBody directive Apache > > gives 413 to user if content length is greater than the value specified > in > > directive but logs as 200. It even appends the response html along with > > error document. This problem happens in httpd-2.4.4 also > > On further debugging 2.2.26 with gdb i found the problem occurs in > > modules/http/http_request.c (ap_process_request) line 291 > > > > if (access_status == OK) { > > ap_finalize_request_protocol(r); > > } > > else { > > r->status = HTTP_OK; > > ap_die(access_status, r); > > } > > What module are you using to write the response? ap_die copies the > first paraemter to r->status so you shouldn't need something special. > > But it doesnt happen like that. the client receives 413 but also the response is appended to the error document <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN"> <html><head> <title>413 Request Entity Too Large</title> </head><body> <h1>Request Entity Too Large</h1> The requested resource<br />/index.php<br /> does not allow request data with POST requests, or the amount of data provided in the request exceeds the capacity limit. <hr> <address>Apache/2.2.22 (Ubuntu) Server at localhost Port 8080</address> </body></html> <html>===>php response HOME </html> The response is logged as 200. Could you try it out on a vhost and do a simple curl to see it > A 413 triggers an error reading the request body. If you ignore it, > things go wrong. If you return the error you receive, it works. > > --------------------------------------------------------------------- > To unsubscribe, e-mail: users-unsubscr...@httpd.apache.org > For additional commands, e-mail: users-h...@httpd.apache.org > > -- Kalyanasundaram http://blogs.eskratch.com/ https://github.com/kalyanceg/