httpd-apreq-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Stas Bekman <s...@stason.org>
Subject Re: [ANN] libapreq2-2.01-dev-rc1 release candidate #1
Date Fri, 07 Nov 2003 08:44:23 GMT
Joe Schaefer wrote:
> Vladimir Dudov <dudov@relexus.com> writes:
> 
> 
>>Looks like apreq_filter() fails because request doesn't have
>>"Content-Type" header. apreq_parser() returns NULL and
>>apreq_parse_request() doesn't parse anything. But why there is no
>>"Content-Type" in the requests? 
> 
> 
> Content-Type isn't required for a GET (it is for POST though).
> What apache server version are you running?  I wonder who is 
> calling ap_get_brigade on the GET- the default handler perhaps?
> 
> Hmm- any clues out there as to why our test suite isn't picking up 
> this bug?  Does Apache::Test's GET_BODY always include a Content-Type
> header?  We need to scuttle 2.01-dev if it doesn't handle a GET
> correctly.

GET_BODY is a just a fancy way to say:

GET(@_)->content

it just sends calls LWP's GET if LWP is available, otherwise it uses a small 
client which sets the Content-Type header only if you pass some content to post:

     my $content = delete $headers->{'content'};
     if ($content) {
         $headers->{'Content-Length'} ||= length $content;
         $headers->{'Content-Type'}   ||= 'application/x-www-form-urlencoded';
     }

Actually you should be using GET_BODY_ASSERT, which also checks whether the 
response wasn't 500. Since 500 also has the response body. So for example if 
you test only the size of the response it may accidently perfectly match the 
expected size. GET_BODY_ASSERT prevents this potential problem.

__________________________________________________________________
Stas Bekman            JAm_pH ------> Just Another mod_perl Hacker
http://stason.org/     mod_perl Guide ---> http://perl.apache.org
mailto:stas@stason.org http://use.perl.org http://apacheweek.com
http://modperlbook.org http://apache.org   http://ticketmaster.com


Mime
View raw message