|
|
|
@ -932,23 +932,43 @@ void App::LogEnvironmentHTTPVariables()
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void App::ParseAcceptHeader()
|
|
|
|
|
void App::ParseAcceptHeader(const wchar_t * header_name, const std::wstring & env, std::vector<HeaderValue> & container, size_t max_len)
|
|
|
|
|
{
|
|
|
|
|
accept_base_parser.parse(cur.request->env_http_accept, cur.request->accept_mime_types, 16);
|
|
|
|
|
accept_base_parser.parse(env, container, max_len);
|
|
|
|
|
|
|
|
|
|
if( !cur.request->accept_mime_types.empty() )
|
|
|
|
|
if( !container.empty() )
|
|
|
|
|
{
|
|
|
|
|
log << log3 << "App: " << Winix::Header::accept << " header consists of: ";
|
|
|
|
|
HeaderValue::log_values(cur.request->accept_mime_types, log);
|
|
|
|
|
log << log3 << "App: " << header_name << " header consists of: ";
|
|
|
|
|
HeaderValue::log_values(container, log);
|
|
|
|
|
log << logend;
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
log << log3 << "App: there is no " << Winix::Header::accept << " header" << logend;
|
|
|
|
|
log << log3 << "App: there is no " << header_name << " header" << logend;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void App::ParseAcceptHeader()
|
|
|
|
|
{
|
|
|
|
|
ParseAcceptHeader(
|
|
|
|
|
Winix::Header::accept,
|
|
|
|
|
cur.request->env_http_accept,
|
|
|
|
|
cur.request->accept_mime_types,
|
|
|
|
|
config.request_max_accept_fields);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void App::ParseAcceptLanguageHeader()
|
|
|
|
|
{
|
|
|
|
|
ParseAcceptHeader(
|
|
|
|
|
Winix::Header::accept_language,
|
|
|
|
|
cur.request->env_http_accept_language,
|
|
|
|
|
cur.request->accept_languages,
|
|
|
|
|
config.request_max_accept_language_fields);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
* reading the request (without GET parameters in the URL)
|
|
|
|
@ -973,6 +993,7 @@ void App::ReadRequest()
|
|
|
|
|
LogEnvironmentHTTPVariables();
|
|
|
|
|
|
|
|
|
|
ParseAcceptHeader();
|
|
|
|
|
ParseAcceptLanguageHeader();
|
|
|
|
|
accept_encoding_parser.ParseAndLog(cur.request->env_http_accept_encoding, log);
|
|
|
|
|
cookie_parser.Parse(cur.request->env_http_cookie, cur.request->cookie_tab);
|
|
|
|
|
|
|
|
|
@ -1014,6 +1035,7 @@ void App::ReadEnvVariables()
|
|
|
|
|
SetEnv("HTTP_COOKIE", cur.request->env_http_cookie);
|
|
|
|
|
SetEnv("HTTP_ACCEPT_ENCODING", cur.request->env_http_accept_encoding);
|
|
|
|
|
SetEnv("HTTP_ACCEPT", cur.request->env_http_accept);
|
|
|
|
|
SetEnv("HTTP_ACCEPT_LANGUAGE", cur.request->env_http_accept_language);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|