Re: [Catacomb] Re: Content-type question.
I fixed the problem.
I asked Greg about the ap_sub_req_lookup_uri and he said it will call mod_mime. As he said, ap_sub_req_lookup_uri calls mod_mime's find_ct. find_ct checks rec->filename.
For some reason, in the catacomb directory area, always the rec->filename is /usr/local/apache2/repos even though I try to put .../repos/aa.gif or something.
I read mod_mime source and figured that there is an option, ModMimeUsePathInfo on. After set the option, ap_sub_req_lookup_uri works fine. [Thank Greg!]
So we should set up catacomb directory like this:
Catacomb try to get the content-type from client and set it. If there is no content-type, Catacomb set content type by calling ap_sub_req_lookup_uri.
Sung Kim <firstname.lastname@example.org>
"Dreams become reality!"
On Wed, 11 Sep 2002, Greg Stein wrote:
> On Tue, Sep 10, 2002 at 12:08:18PM -0700, email@example.com wrote:
> > Date: Mon, 9 Sep 2002 20:42:19 -0700 (PDT)
> > From: Sung Kim <firstname.lastname@example.org>
> > To: email@example.com
> > Subject: [Catacomb]
> > Hello,
> > Do you know how can we deal the content type with the PUT method? Several clients such as Skunkdav always give me "application/octet-stream".
> > Let's suppose a client PUT "index.html" with "application/octet-stream". Should we also say index.html's content type is "application/octet-stream", when a client try to GET?
> If the client sends the wrong type, then the client is the problem. I don't
> see a big need to support bad clients. That will just continue to ensure
> that they will always use bad behavior.
> Take the supplied Content-Type and store it.
> > I asked several server implementers, and they said usually they ignore PUT content-type.
> mod_dav_fs ignores it, but don't take that as gospel. That is mostly for
> performance reasons -- where would we put it? and how would we fetch it
> again? I chose to use Apache's builtin mime type determination instead.
> > Than, how can we figure out content type with filename?
> > Does Apache have "const char *apr_get_content_type(const char *filename)". I tried to find, but I couldn't find that kind of function. Mod_dav looks like to use "ap_sub_req_lookup_uri", but it doesn't work with Catacomb.
> This kind of stuff is in mod_mime and mod_mime_magic, I believe. Since those
> functions are in a module rather than Apache "proper", there isn't really a
> way to call them.
> > Should I parse "mime.types"?
> No, I don't think so. If you can identify a function within Apache to do the
> file-extension to type mapping (if you go that route), then we can see about
> getting it moved to an appropriate spot and exported from Apache.
> Greg Stein, http://www.lyra.org/
> Catacomb mailing list