On 09/25/12 14:04, Ben Noordhuis wrote:
On Tue, Sep 25, 2012 at 1:15 PM, Ivan Prostran <ivan.prost...@bulb.hr> wrote:
Hi,

I have the following scenario :

- Apache/2.2.19 (Solaris 10 SPARC)

      SetInputFilter alterxmlbody (AP_FTYPE_RESOURCE)
      SetHandler weblogic-handler


The handler forwards requests to multiple weblogic servers
and the filter itself analyzes and/or changes the POST data
in a way that the length of the incoming request may be changed.

The question is :

What is the proper and legitimate way to deal with this situation?


Should the input filter set the new CL value in "headers_in" before
returning from the callback, or just remove it from the list?


apr_off_t length;
apr_brigade_length     (bb,1,&length);
apr_table_setn(f->r->headers_in, "Content-Length", apr_off_t_toa(f->r->pool,
length));

Unfortunately, this approach breaks the pipeline because sometimes
the filter needs to buffer data over more than one call, but I do not
consider this as a problem.

or

apr_table_unset(f->r->headers_in, "Content-Length");
You didn't tell how your handler works (how it forwards the request)
but removing the Content-Length header is probably easiest.
To my knowledge this can be done as follows:

   -  When "ap_init_filter_func" callback is invoked
       (before the handler requests data from the client)

    -  within "ap_in_filter_func" callback.

   I tried but it didn't help, infact it didn't work at all.

Does the
upstream server understand HTTP/1.1 or HTTP/1.0 with a TE header?

Yes, It understands HTTP/1.1.
Do you suggest chunked transfer encoding?

Thanks for the help.

Best regards,
Ivan

Reply via email to