You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@httpd.apache.org by Doug MacEachern <do...@covalent.net> on 2001/05/23 22:51:58 UTC

no headers in error response

fresh update/build with the threaded mpm.. there are no headers in the
response when a handler return an error:

% telnet localhost 8082
Trying 127.0.0.1...
Connected to mako.covalent.net.
Escape character is '^]'.
GET / http/1.0

<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
<HTML><HEAD>
<TITLE>403 Forbidden</TITLE>
</HEAD><BODY>
<H1>Forbidden</H1>
You don't have permission to access /
on this server.<P>
<HR>
<ADDRESS>Apache/2.0.19-dev Server at mako.covalent.net Port 80</ADDRESS>
</BODY></HTML>
Connection closed by foreign host.

produced with this lil module:

#include "httpd.h"
#include "http_config.h"
#include "http_protocol.h"
#include "http_request.h"
#include "ap_config.h"

static int err_access(request_rec *r)
{
    return 403;
}

static void err_register_hooks(apr_pool_t *p)
{
    ap_hook_access_checker(err_access, NULL, NULL, APR_HOOK_MIDDLE);
}

module AP_MODULE_DECLARE_DATA err_module = {
    STANDARD20_MODULE_STUFF, 
    NULL,                  /* create per-dir    config structures */
    NULL,                  /* merge  per-dir    config structures */
    NULL,                  /* create per-server config structures */
    NULL,                  /* merge  per-server config structures */
    NULL,                  /* table of config file commands       */
    err_register_hooks  /* register hooks                      */
};



Re: no headers in error response

Posted by Doug MacEachern <do...@covalent.net>.
On Wed, 23 May 2001, Roy T. Fielding wrote:
 
> Try it with
> 
>   GET / HTTP/1.0

same response, no headers.  i first noticed the problem using lwp, which
always sends uppercase HTTP/1.0.  same problem can be seen stracing
netscape:

write(17, "GET / HTTP/1.0\r\nConnection: Keep"..., 301) = 301
read(17, "<!DOCTYPE HTML PUBLIC \"-//IETF//"..., 260) = 260



Re: no headers in error response

Posted by Doug MacEachern <do...@covalent.net>.
On Wed, 23 May 2001, Roy T. Fielding wrote:
 
> the version is case-sensitive.

might make a difference for 1.1, but for 1.0 r->assbackwards is still 0,
so headers should be sent:

(gdb) p r->protocol
$1 = 0x815740c "http/1.0"
(gdb) p r->assbackwards
$2 = 0



Re: no headers in error response

Posted by "Roy T. Fielding" <fi...@ebuilt.com>.
On Wed, May 23, 2001 at 01:51:58PM -0700, Doug MacEachern wrote:
> fresh update/build with the threaded mpm.. there are no headers in the
> response when a handler return an error:
> 
> % telnet localhost 8082
> Trying 127.0.0.1...
> Connected to mako.covalent.net.
> Escape character is '^]'.
> GET / http/1.0

Try it with

  GET / HTTP/1.0

the version is case-sensitive.

....Roy