You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cvs@httpd.apache.org by jo...@apache.org on 2010/05/24 12:44:11 UTC

svn commit: r947593 - in /httpd/test/framework/trunk/t: apache/pr49328.t conf/extra.conf.in htdocs/modules/filter/ htdocs/modules/filter/included.shtml htdocs/modules/filter/pr49328.shtml

Author: jorton
Date: Mon May 24 10:44:11 2010
New Revision: 947593

URL: http://svn.apache.org/viewvc?rev=947593&view=rev
Log:
- add test case for PR 49328

Added:
    httpd/test/framework/trunk/t/apache/pr49328.t
    httpd/test/framework/trunk/t/htdocs/modules/filter/
    httpd/test/framework/trunk/t/htdocs/modules/filter/included.shtml
    httpd/test/framework/trunk/t/htdocs/modules/filter/pr49328.shtml
Modified:
    httpd/test/framework/trunk/t/conf/extra.conf.in

Added: httpd/test/framework/trunk/t/apache/pr49328.t
URL: http://svn.apache.org/viewvc/httpd/test/framework/trunk/t/apache/pr49328.t?rev=947593&view=auto
==============================================================================
--- httpd/test/framework/trunk/t/apache/pr49328.t (added)
+++ httpd/test/framework/trunk/t/apache/pr49328.t Mon May 24 10:44:11 2010
@@ -0,0 +1,25 @@
+use strict;
+use warnings FATAL => 'all';
+
+use Apache::Test;
+use Apache::TestUtil;
+use Apache::TestRequest;
+
+plan tests => 1, need [qw(filter include deflate)];
+
+my $inflator = "/modules/deflate/echo_post";
+
+my @deflate_headers;
+push @deflate_headers, "Accept-Encoding" => "gzip";
+
+my @inflate_headers;
+push @inflate_headers, "Content-Encoding" => "gzip";
+
+my $uri = "/modules/filter/pr49328.shtml";
+
+my $content = GET_BODY($uri, @deflate_headers);
+
+my $deflated = POST_BODY($inflator, @inflate_headers,
+                         content => $content);
+
+ok t_cmp($deflated, "before\nincluded\nafter\n");

Modified: httpd/test/framework/trunk/t/conf/extra.conf.in
URL: http://svn.apache.org/viewvc/httpd/test/framework/trunk/t/conf/extra.conf.in?rev=947593&r1=947592&r2=947593&view=diff
==============================================================================
--- httpd/test/framework/trunk/t/conf/extra.conf.in (original)
+++ httpd/test/framework/trunk/t/conf/extra.conf.in Mon May 24 10:44:11 2010
@@ -561,3 +561,22 @@ LimitRequestFields    32
 <IfModule mod_status.c>
    ExtendedStatus On
 </IfModule>
+
+<IfModule mod_filter.c>
+   <Directory @SERVERROOT@/htdocs/modules/filter>
+       Options +Includes
+       AddType text/html .shtml
+       AddOutputFilter INCLUDES .shtml
+
+       FilterDeclare pr49328 CONTENT_SET
+       <IfVersion < 2.3.0> 
+          FilterProvider pr49328 DEFLATE resp=Content-Type $text/
+       </IfVersion>
+       <IfVersion >= 2.3.0>
+          # resp{Content-Type} = /text/ should be equivalent but      
+          # doesn't seem to work.
+          FilterProvider pr49328 DEFLATE "true == true"
+       </IfVersion>
+       FilterChain pr49328
+   </Directory>
+</IfModule>
\ No newline at end of file

Added: httpd/test/framework/trunk/t/htdocs/modules/filter/included.shtml
URL: http://svn.apache.org/viewvc/httpd/test/framework/trunk/t/htdocs/modules/filter/included.shtml?rev=947593&view=auto
==============================================================================
--- httpd/test/framework/trunk/t/htdocs/modules/filter/included.shtml (added)
+++ httpd/test/framework/trunk/t/htdocs/modules/filter/included.shtml Mon May 24 10:44:11 2010
@@ -0,0 +1 @@
+included
\ No newline at end of file

Added: httpd/test/framework/trunk/t/htdocs/modules/filter/pr49328.shtml
URL: http://svn.apache.org/viewvc/httpd/test/framework/trunk/t/htdocs/modules/filter/pr49328.shtml?rev=947593&view=auto
==============================================================================
--- httpd/test/framework/trunk/t/htdocs/modules/filter/pr49328.shtml (added)
+++ httpd/test/framework/trunk/t/htdocs/modules/filter/pr49328.shtml Mon May 24 10:44:11 2010
@@ -0,0 +1,3 @@
+before
+<!--#include virtual="included.shtml" -->
+after



Re: svn commit: r947593 - in /httpd/test/framework/trunk/t: apache/pr49328.t conf/extra.conf.in htdocs/modules/filter/ htdocs/modules/filter/included.shtml htdocs/modules/filter/pr49328.shtml

Posted by Joe Orton <jo...@redhat.com>.
On Mon, May 24, 2010 at 02:39:29PM +0200, Ruediger Pluem wrote:
> On 24.05.2010 12:44, jorton@apache.org wrote:
> > +       <IfVersion >= 2.3.0>
> > +          # resp{Content-Type} = /text/ should be equivalent but      
> > +          # doesn't seem to work.
> > +          FilterProvider pr49328 DEFLATE "true == true"
> 
> Try "$content-type = /text\//" instead. I noticed this issue too and
> suppose that is caused by r->content_type being set at this point of
> time Content-Type not being set in headers_out at this point of time.

Yes, that is exactly right, much obliged!  (the examples in the docs 
should be fixed too I suppose, Nick are you following?)

Regards, Joe

Re: svn commit: r947593 - in /httpd/test/framework/trunk/t: apache/pr49328.t conf/extra.conf.in htdocs/modules/filter/ htdocs/modules/filter/included.shtml htdocs/modules/filter/pr49328.shtml

Posted by Ruediger Pluem <rp...@apache.org>.
On 24.05.2010 12:44, jorton@apache.org wrote:
> Author: jorton
> Date: Mon May 24 10:44:11 2010
> New Revision: 947593
> 
> URL: http://svn.apache.org/viewvc?rev=947593&view=rev
> Log:
> - add test case for PR 49328
> 
> Added:
>     httpd/test/framework/trunk/t/apache/pr49328.t
>     httpd/test/framework/trunk/t/htdocs/modules/filter/
>     httpd/test/framework/trunk/t/htdocs/modules/filter/included.shtml
>     httpd/test/framework/trunk/t/htdocs/modules/filter/pr49328.shtml
> Modified:
>     httpd/test/framework/trunk/t/conf/extra.conf.in
> 
> Added: httpd/test/framework/trunk/t/apache/pr49328.t
> URL: http://svn.apache.org/viewvc/httpd/test/framework/trunk/t/apache/pr49328.t?rev=947593&view=auto
> ==============================================================================
> --- httpd/test/framework/trunk/t/apache/pr49328.t (added)
> +++ httpd/test/framework/trunk/t/apache/pr49328.t Mon May 24 10:44:11 2010
> @@ -0,0 +1,25 @@
> +use strict;
> +use warnings FATAL => 'all';
> +
> +use Apache::Test;
> +use Apache::TestUtil;
> +use Apache::TestRequest;
> +
> +plan tests => 1, need [qw(filter include deflate)];
> +
> +my $inflator = "/modules/deflate/echo_post";
> +
> +my @deflate_headers;
> +push @deflate_headers, "Accept-Encoding" => "gzip";
> +
> +my @inflate_headers;
> +push @inflate_headers, "Content-Encoding" => "gzip";
> +
> +my $uri = "/modules/filter/pr49328.shtml";
> +
> +my $content = GET_BODY($uri, @deflate_headers);
> +
> +my $deflated = POST_BODY($inflator, @inflate_headers,
> +                         content => $content);
> +
> +ok t_cmp($deflated, "before\nincluded\nafter\n");
> 
> Modified: httpd/test/framework/trunk/t/conf/extra.conf.in
> URL: http://svn.apache.org/viewvc/httpd/test/framework/trunk/t/conf/extra.conf.in?rev=947593&r1=947592&r2=947593&view=diff
> ==============================================================================
> --- httpd/test/framework/trunk/t/conf/extra.conf.in (original)
> +++ httpd/test/framework/trunk/t/conf/extra.conf.in Mon May 24 10:44:11 2010
> @@ -561,3 +561,22 @@ LimitRequestFields    32
>  <IfModule mod_status.c>
>     ExtendedStatus On
>  </IfModule>
> +
> +<IfModule mod_filter.c>
> +   <Directory @SERVERROOT@/htdocs/modules/filter>
> +       Options +Includes
> +       AddType text/html .shtml
> +       AddOutputFilter INCLUDES .shtml
> +
> +       FilterDeclare pr49328 CONTENT_SET
> +       <IfVersion < 2.3.0> 
> +          FilterProvider pr49328 DEFLATE resp=Content-Type $text/
> +       </IfVersion>
> +       <IfVersion >= 2.3.0>
> +          # resp{Content-Type} = /text/ should be equivalent but      
> +          # doesn't seem to work.
> +          FilterProvider pr49328 DEFLATE "true == true"

Try "$content-type = /text\//" instead. I noticed this issue too and
suppose that is caused by r->content_type being set at this point of
time Content-Type not being set in headers_out at this point of time.

Regards

RĂ¼diger