httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cronfy <cro...@gmail.com>
Subject Re: Sending http headers for 3xx responses
Date Sun, 26 Dec 2010 09:35:12 GMT
Thanks, I tried it. Currently filter function looks like this:

static apr_status_t procinfo_filter(ap_filter_t *f,
                                   apr_bucket_brigade *b)
{
    _DBG("IN FILTER", 0);

    request_rec *r;
    apr_table_t *t;
    char *msg;

    r = f->r;
    procinfo_config_t *cf = ap_get_module_config(r->connection->conn_config,
                                              &procinfo_module);

    msg = apr_psprintf(r->pool, "%s", "test");

    t = r->headers_out;
    apr_table_set(t, "X-Process-Info", msg);
    t = r->err_headers_out;
    apr_table_set(t, "X-Process-Info", msg);

    ap_remove_output_filter(f);

    return ap_pass_brigade(f->next, b);
}

With no luck for 3xx responses. It works even for 404 Not Found, but not for
3xx.




> 3xx is considered an "error" as far as headers are concerned, so use the
> err_headers
>
>  Issac
>
>
> On 26/12/2010 10:58, cronfy wrote:
> > Hello.
> >
> > I am trying to create a module that would send some response headers
> > related to request. I've taken mod_expires code and adapted it for my
> > needs. Everything works fine for 200 responses, but when response is
> > "304 Not Modified", my headers do not appear there.
> >
> > I tried to set r->headers_out and r->err_headers_out, but it does not
> > work. The filter function runs on every request indeed, I checked it
> > with debug right near
> >
> >     t = r->headers_out;
> >     apr_table_set(t, "X-Process-Info", msg);
> >
> > But X-Process-Info: is not in the output still. What am I missing?
> >
> > Thanks in advance!
> >
> > --
> > // cronfy
>
>


-- 
// cronfy

Mime
View raw message