httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Dean Gaudet <dgau...@arctic.org>
Subject Re: [PATCH] PR#506: no DefaultType means no Content-Type
Date Mon, 05 May 1997 20:51:47 GMT
Hmm the code as it stands will DefaultType a CGI's output, but won't
DEFAULT_TYPE (i.e. no DefaultType directive) a CGI's output.  For some
reason I was thinking content-type was a required header, but upon
checking I discover it isn't required.

The current behaviour could be considered inconsistent (it is, the code
uses default_type(r) here and there but not in the final header
generation).  My patch makes it consistent, but doesn't match up with what
you're saying below.

What you say makes sense.  So I'm not sure what to do.

Dean

On Mon, 5 May 1997, Roy T. Fielding wrote:

> >The best place might be in http_core, add a type_checker function like
> >this:
> >
> >static int core_type_checker (request_rec *r)
> >{
> >    if (!r->content_type) {
> >	r->content_type = default_type (r);
> >    }
> >    return OK;
> >}
> 
> For normal files, I think that is the best way to do it.  However, we
> need to be careful not to add a default type to proxy responses.
> Likewise, CGI output without a content-type should not be given the
> default.  I'm not sure what the above would do for those cases.
> 
> The basic rule of thumb is that content-type should only be given if
> it is known (by configuration, name, magic typing, etc.).  If it is not
> given, a browser will use its own heuristics for determining the type.
> 
> ....Roy
> 


Mime
View raw message