mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-02-13 03:24:26 +00:00
Bug #30144 --> correctly set the user agent for messenger to be the same user agent http is using. We were
incorrectly setting to be the app name (Mozilla 5.0) which is the same in both the mozilla and commercial builds. r=alecf a=phil,jar
This commit is contained in:
parent
07efd04099
commit
b95f493d38
@ -427,35 +427,21 @@ mime_generate_headers (nsMsgCompFields *fields,
|
||||
NS_WITH_SERVICE(nsIHTTPProtocolHandler, pHTTPHandler, kHTTPHandlerCID, &rv);
|
||||
if (NS_SUCCEEDED(rv) && pHTTPHandler)
|
||||
{
|
||||
PRUnichar *aAppName = nsnull;
|
||||
nsXPIDLString userAgentString;
|
||||
nsCAutoString cStr;
|
||||
|
||||
if (NS_SUCCEEDED(pHTTPHandler->GetAppName(&aAppName)))
|
||||
{
|
||||
cStr = aAppName;
|
||||
PR_FREEIF(aAppName);
|
||||
}
|
||||
else
|
||||
cStr = "Netscape";
|
||||
pHTTPHandler->GetUserAgent(getter_Copies(userAgentString));
|
||||
cStr = userAgentString;
|
||||
|
||||
if (!cStr.IsEmpty())
|
||||
{
|
||||
// PUSH_STRING ("X-Mailer: "); // To be more standards compliant
|
||||
PUSH_STRING ("User-Agent: ");
|
||||
PUSH_STRING(cStr);
|
||||
|
||||
nsXPIDLString appInfo;
|
||||
pHTTPHandler->GetAppVersion(getter_Copies(appInfo));
|
||||
nsCAutoString cStr2 (appInfo);
|
||||
if (!cStr2.IsEmpty())
|
||||
{
|
||||
PUSH_STRING (" ");
|
||||
PUSH_STRING(cStr2);
|
||||
}
|
||||
PUSH_NEWLINE ();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/* for Netscape Server, Accept-Language data sent in Mail header */
|
||||
char *acceptlang = nsMsgI18NGetAcceptLanguage();
|
||||
if( (acceptlang != NULL) && ( *acceptlang != '\0') ){
|
||||
|
Loading…
x
Reference in New Issue
Block a user