Bug fix: don't get web profile when grid does not support that.

This commit is contained in:
Aleric Inglewood
2013-07-15 02:38:10 +02:00
parent 6a7f7bf4de
commit 6fd0baae5d
2 changed files with 17 additions and 12 deletions

View File

@@ -52,6 +52,7 @@ static const std::string PANEL_PICKS = "panel_picks";
std::string getProfileURL(const std::string& agent_name) std::string getProfileURL(const std::string& agent_name)
{ {
std::string url = gSavedSettings.getString("WebProfileURL"); std::string url = gSavedSettings.getString("WebProfileURL");
llassert(!url.empty());
LLSD subs; LLSD subs;
subs["AGENT_NAME"] = agent_name; subs["AGENT_NAME"] = agent_name;
url = LLWeb::expandURLSubstitutions(url,subs); url = LLWeb::expandURLSubstitutions(url,subs);

View File

@@ -1446,20 +1446,24 @@ void LLViewerMedia::setOpenIDCookie()
getCookieStore()->setCookiesFromHost(sOpenIDCookie, authority.substr(host_start, host_end - host_start)); getCookieStore()->setCookiesFromHost(sOpenIDCookie, authority.substr(host_start, host_end - host_start));
// Do a web profile get so we can store the cookie // Does grid supports web profiles at all?
AIHTTPHeaders headers; if (!gSavedSettings.getString("WebProfileURL").empty())
headers.addHeader("Accept", "*/*"); {
headers.addHeader("Cookie", sOpenIDCookie); // Do a web profile get so we can store the cookie
headers.addHeader("User-Agent", getCurrentUserAgent()); AIHTTPHeaders headers;
headers.addHeader("Accept", "*/*");
headers.addHeader("Cookie", sOpenIDCookie);
headers.addHeader("User-Agent", getCurrentUserAgent());
std::string profile_url = getProfileURL(""); std::string profile_url = getProfileURL("");
LLURL raw_profile_url( profile_url.c_str() ); LLURL raw_profile_url( profile_url.c_str() );
LL_DEBUGS("MediaAuth") << "Requesting " << profile_url << llendl; LL_DEBUGS("MediaAuth") << "Requesting " << profile_url << llendl;
LL_DEBUGS("MediaAuth") << "sOpenIDCookie = [" << sOpenIDCookie << "]" << llendl; LL_DEBUGS("MediaAuth") << "sOpenIDCookie = [" << sOpenIDCookie << "]" << llendl;
LLHTTPClient::get(profile_url, LLHTTPClient::get(profile_url,
new LLViewerMediaWebProfileResponder(raw_profile_url.getAuthority()), new LLViewerMediaWebProfileResponder(raw_profile_url.getAuthority()),
headers); headers);
}
} }
} }