Lines 273-315
Link Here
|
273 |
if (!strncmp(r->filename, "redirect:", 9)) return DECLINED; |
273 |
if (!strncmp(r->filename, "redirect:", 9)) return DECLINED; |
274 |
if (!strncmp(r->filename, "gone:", 5)) return DECLINED; |
274 |
if (!strncmp(r->filename, "gone:", 5)) return DECLINED; |
275 |
if (!strncmp(r->filename, "passthrough:", 12)) return DECLINED; |
275 |
if (!strncmp(r->filename, "passthrough:", 12)) return DECLINED; |
276 |
if (!strncmp(r->filename, "forbidden:", 10)) return DECLINED; |
276 |
if (!strncmp(r->filename, "forbidden:", 10)) return DECLINED; |
277 |
|
277 |
|
278 |
mime_type = r->content_type ? r->content_type : ap_default_type(r); |
278 |
mime_type = r->content_type ? r->content_type : ap_default_type(r); |
279 |
|
279 |
|
280 |
/* If mime type isn't text or message, bail out. |
280 |
/* If mime type isn't set or is not text or message, bail out. |
281 |
*/ |
281 |
*/ |
282 |
|
282 |
|
283 |
/* XXX When we handle translation of the request body, watch out here as |
283 |
/* XXX When we handle translation of the request body, watch out here as |
284 |
* 1.3 allowed additional mime types: multipart and |
284 |
* 1.3 allowed additional mime types: multipart and |
285 |
* application/x-www-form-urlencoded |
285 |
* application/x-www-form-urlencoded |
286 |
*/ |
286 |
*/ |
287 |
|
287 |
|
288 |
if (strncasecmp(mime_type, "text/", 5) && |
288 |
if (!mime_type || |
|
|
289 |
(strncasecmp(mime_type, "text/", 5) && |
289 |
#if APR_CHARSET_EBCDIC |
290 |
#if APR_CHARSET_EBCDIC |
290 |
/* On an EBCDIC machine, be willing to translate mod_autoindex- |
291 |
/* On an EBCDIC machine, be willing to translate mod_autoindex- |
291 |
* generated output. Otherwise, it doesn't look too cool. |
292 |
* generated output. Otherwise, it doesn't look too cool. |
292 |
* |
293 |
* |
293 |
* XXX This isn't a perfect fix because this doesn't trigger us |
294 |
* XXX This isn't a perfect fix because this doesn't trigger us |
294 |
* to convert from the charset of the source code to ASCII. The |
295 |
* to convert from the charset of the source code to ASCII. The |
295 |
* general solution seems to be to allow a generator to set an |
296 |
* general solution seems to be to allow a generator to set an |
296 |
* indicator in the r specifying that the body is coded in the |
297 |
* indicator in the r specifying that the body is coded in the |
297 |
* implementation character set (i.e., the charset of the source |
298 |
* implementation character set (i.e., the charset of the source |
298 |
* code). This would get several different types of documents |
299 |
* code). This would get several different types of documents |
299 |
* translated properly: mod_autoindex output, mod_status output, |
300 |
* translated properly: mod_autoindex output, mod_status output, |
300 |
* mod_info output, hard-coded error documents, etc. |
301 |
* mod_info output, hard-coded error documents, etc. |
301 |
*/ |
302 |
*/ |
302 |
strcmp(mime_type, DIR_MAGIC_TYPE) && |
303 |
strcmp(mime_type, DIR_MAGIC_TYPE) && |
303 |
#endif |
304 |
#endif |
304 |
strncasecmp(mime_type, "message/", 8)) { |
305 |
strncasecmp(mime_type, "message/", 8))) { |
305 |
if (dc->debug >= DBGLVL_GORY) { |
306 |
if (dc->debug >= DBGLVL_GORY) { |
306 |
ap_log_rerror(APLOG_MARK, APLOG_DEBUG, 0, r, |
307 |
ap_log_rerror(APLOG_MARK, APLOG_DEBUG, 0, r, |
307 |
"mime type is %s; no translation selected", |
308 |
"mime type is %s; no translation selected", |
308 |
mime_type); |
309 |
mime_type ? mime_type : "not present"); |
309 |
} |
310 |
} |
310 |
return DECLINED; |
311 |
return DECLINED; |
311 |
} |
312 |
} |
312 |
|
313 |
|
313 |
if (dc->debug >= DBGLVL_GORY) { |
314 |
if (dc->debug >= DBGLVL_GORY) { |
314 |
ap_log_rerror(APLOG_MARK, APLOG_DEBUG, 0, r, |
315 |
ap_log_rerror(APLOG_MARK, APLOG_DEBUG, 0, r, |
315 |
"charset_source: %s charset_default: %s", |
316 |
"charset_source: %s charset_default: %s", |