Re: Creating a filter for all text/html files

[prev] [thread] [next] [Date index for 2005/02/01]

From: Philippe M. Chiasson
Subject: Re: Creating a filter for all text/html files
Date: 18:50 on 01 Feb 2005
This is an OpenPGP/MIME signed message (RFC 2440 and 3156)
--------------enig11FC079CDDD22799E804D46E
Content-Type: text/plain; charset=us-ascii; format=flowed
Content-Transfer-Encoding: 7bit

Scott Gifford wrote:
> Hello,
> 
> [...]
>
> I've got it working right now, but I'd like it to know the
> Content-Type that Apache would use for a document, so I can decide
> whether to filter it and so I can send a correct Content-Type header.

$r->content_type should tell you that.

http://perl.apache.org/docs/2.0/api/Apache/RequestRec.html#C_content_type_

> I can try to guess the content-type from the filename (which is what
> I'm doing now), but I'd prefer not to re-implement Apache's system for
> deciding content types, and I'd also like it to Do The Right Thing for
> CGI/mod_perl scripts, where you can't tell by the filename what
> content-type they're going to output.

Yes, certainly a good idea not to do anything of the sort. Let Apache tell you
that.

--------------------------------------------------------------------------------
Philippe M. Chiasson m/gozer\@(apache|cpan|ectoplasm)\.org/ GPG KeyID : 88C3A5A5
http://gozer.ectoplasm.org/     F9BF E0C2 480E 7680 1AE5 3631 CB32 A107 88C3A5A5

--------------enig11FC079CDDD22799E804D46E
Content-Type: application/pgp-signature; name="signature.asc"
Content-Description: OpenPGP digital signature
Content-Disposition: attachment; filename="signature.asc"

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.6 (GNU/Linux)
Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org

iD8DBQFB/89uyzKhB4jDpaURApmgAJoDLfkpN3x/lIvilQt9yxGu/UxV/wCfT8Ub
H1exPOtP42vW3dRKA53/4m0=
=T4hC
-----END PGP SIGNATURE-----

--------------enig11FC079CDDD22799E804D46E--

Creating a filter for all text/html files
Scott Gifford 03:49 on 31 Jan 2005

Re: Creating a filter for all text/html files
Philippe M. Chiasson 18:50 on 01 Feb 2005

Re: Creating a filter for all text/html files
Scott Gifford 07:39 on 03 Feb 2005

Re: Creating a filter for all text/html files
Geoffrey Young 19:01 on 01 Feb 2005

Generated at 12:39 on 05 Feb 2005 by mariachi v0.52