You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@httpd.apache.org by Petr Gajdos <pg...@suse.cz> on 2016/09/21 09:04:17 UTC

[users@httpd] failing t/modules/filter.t

Hi list,

the test does not succed for me. If I got it correctly, it creates
test.xml with the content 'helloworld' and tries to add CASEFILTER to
it trough AddOutputFilterByType with application/xml. That does not
work for me, but does with text/xml as example [1] shows.

Where the truth is?

Petr

[1] https://github.com/pgajdos/apache-rex/tree/master/mod_filter-AddOutputFilterByType


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: [users@httpd] failing t/modules/filter.t

Posted by Petr Gajdos <pg...@suse.cz>.
On Wed, Oct 26, 2016 at 09:58:57AM +0200, Yann Ylavic wrote:
> On Tue, Oct 25, 2016 at 9:48 PM, Petr Gajdos <pg...@suse.cz> wrote:
> >
> > So if I understand correctly, content of mime.types is hardcoded.
> > Is there another chance than patching either TestConfig.pm or
> > extra.conf.in to contain application/xml .xml definition?
> 
> Don't you have a piece of conf that applies to your test and where you can set:
>    AddType application/xml .xml

Thank you, I guess problem resolved. 

I run testsuite on buildroot in two modes, with some sort of minimal
configuration file (given by -httpd_conf) and also manually for
debugging without -httpd_conf option at all, which seem to consult
/etc/apache2/httpd.conf to create t/conf/httpd.conf. Neither of them 
worked (for different reason from what I did not know until now) which
lead to confusion on my side.

If I get all correctly, in the first case the hardcoded mime.types I
have already mentioned is used. There is no xml assignment so no
wonder. In second case the testsuite detected /etc/apache2/mime.types
inclusion in /etc/apache2/httpd.conf and that file was included in
t/conf/httpd.conf.

But, /etc/apache2/mime.types contains:
application/xml                                  xml xsl
[..]
text/xml                                         xml

According to my testing, the latter map shadowed the first one. When I
switched the order, the test worked.

Because of the hope, that the package I am just creating will be
installable and user will certainly use own mime.types, I would like
not to have a test depend on the order there. So I think that could
help me:
https://build.opensuse.org/package/view_file/Apache:Test/apache-test/apache-test-application-xml-type.patch

Petr


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: [users@httpd] failing t/modules/filter.t

Posted by Yann Ylavic <yl...@gmail.com>.
On Tue, Oct 25, 2016 at 9:48 PM, Petr Gajdos <pg...@suse.cz> wrote:
>
> So if I understand correctly, content of mime.types is hardcoded.
> Is there another chance than patching either TestConfig.pm or
> extra.conf.in to contain application/xml .xml definition?

Don't you have a piece of conf that applies to your test and where you can set:
   AddType application/xml .xml
?

Regards,
Yann.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: [users@httpd] failing t/modules/filter.t

Posted by Petr Gajdos <pg...@suse.cz>.
> On Wed, Sep 21, 2016 at 08:38:25PM +0200, Yann Ylavic wrote:
> > Without any AddType directive relative to ".xml" files in your
> > configuration, the Content-Type is set according to the
> > "conf/mimes.types" file.
> > What's in yours for the "xml" extension?
> 
> You are correct. There is no reference to xml extension in
> t/conf/*.conf or t/conf/mime.types. I will try to check how
> t/conf/mime.types is generated. 

In Apache-Test/lib/Apache/TestConfig.pm, there is:

sub types_config_template {
    return <<EOF;
text/html  html htm
image/gif  gif
image/jpeg jpeg jpg jpe
image/png  png
text/plain asc txt
EOF
}

sub generate_types_config {
    my $self = shift;

    # handle the case when mod_mime is built as a shared object
    # but wasn't included in the system-wide httpd.conf
    $self->find_and_load_module('mod_mime.so');

    unless ($self->{inherit_config}->{TypesConfig}) {
        my $types = catfile $self->{vars}->{t_conf}, 'mime.types';
        unless (-e $types) {
            my $fh = $self->genfile($types);
            print $fh $self->types_config_template;
            close $fh;
        }
        $self->postamble(<<EOI);
<IfModule mod_mime.c>
    TypesConfig "$types"
</IfModule>
EOI
    }
}

So if I understand correctly, content of mime.types is hardcoded.
Is there another chance than patching either TestConfig.pm or
extra.conf.in to contain application/xml .xml definition?

Petr


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: [users@httpd] failing t/modules/filter.t

Posted by Petr Gajdos <pg...@suse.cz>.
On Wed, Sep 21, 2016 at 08:38:25PM +0200, Yann Ylavic wrote:
> Without any AddType directive relative to ".xml" files in your
> configuration, the Content-Type is set according to the
> "conf/mimes.types" file.
> What's in yours for the "xml" extension?

You are correct. There is no reference to xml extension in
t/conf/*.conf or t/conf/mime.types. I will try to check how
t/conf/mime.types is generated. 

Thanks,
Petr


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: [users@httpd] failing t/modules/filter.t

Posted by Yann Ylavic <yl...@gmail.com>.
On Wed, Sep 21, 2016 at 11:04 AM, Petr Gajdos <pg...@suse.cz> wrote:
>
> the test does not succed for me. If I got it correctly, it creates
> test.xml with the content 'helloworld' and tries to add CASEFILTER to
> it trough AddOutputFilterByType with application/xml. That does not
> work for me, but does with text/xml as example [1] shows.

Without any AddType directive relative to ".xml" files in your
configuration, the Content-Type is set according to the
"conf/mimes.types" file.
What's in yours for the "xml" extension?

Regards,
Yann.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org