--- parser3/src/main/pa_request.C 2002/08/02 09:32:38 1.220 +++ parser3/src/main/pa_request.C 2002/08/12 07:59:06 1.223 @@ -5,7 +5,7 @@ Author: Alexandr Petrosian (http://paf.design.ru) */ -static const char* IDENT_REQUEST_C="$Date: 2002/08/02 09:32:38 $"; +static const char* IDENT_REQUEST_C="$Date: 2002/08/12 07:59:06 $"; #include "pa_sapi.h" #include "pa_common.h" @@ -553,10 +553,10 @@ void Request::output_result(const VFile& // header: cookies cookie.output_result(); - VString *body_file_content_type; + Value *body_file_content_type; // set content-type - if(body_file_content_type=static_cast( - body_file.fields().get(*vfile_mime_type_name))) { + if(body_file_content_type=static_cast( + body_file.fields().get(*content_type_name))) { // body file content type response.fields().put(*content_type_name, body_file_content_type); } else { @@ -580,6 +580,9 @@ void Request::output_result(const VFile& const void *client_body; size_t client_content_length; // transcode text body when "text/*" or simple result + if(body_file_content_type) + if(Hash *hash=body_file_content_type->get_hash(0)) + body_file_content_type=static_cast(hash->get(*value_name)); if(!body_file_content_type/*vstring.as_vfile*/ || body_file_content_type->as_string().pos("text/")==0) { Charset::transcode(pool(), pool().get_source_charset(), body_file.value_ptr(), body_file.value_size(), @@ -607,7 +610,7 @@ const String& Request::mime_type_of(cons if(mime_types) if(const char *cext=strrchr(user_file_name_cstr, '.')) { String sext(pool(), ++cext); - if(mime_types->locate(0, sext)) + if(mime_types->locate(0, sext.change_case(pool(), String::CC_LOWER))) if(const String *result=mime_types->item(1)) return *result; else