diff options
author | Rider Linden <rider@lindenlab.com> | 2015-06-17 14:41:28 -0700 |
---|---|---|
committer | Rider Linden <rider@lindenlab.com> | 2015-06-17 14:41:28 -0700 |
commit | 82e34f1683f67b8394306b1569260508a213b99e (patch) | |
tree | 7bdd15eeab42de095d68c775db59b5ccf6e257c8 /indra/newview/llfacebookconnect.cpp | |
parent | 4a4470af3210153e0909eb75d51de461d14a3128 (diff) |
https://jira.secondlife.com/browse/MAINT-5283
The default behavior in the HTTP layer changed to follow redirects automatically.
This was causing a problem with connecting to the SL share service which was attempting to
riderect to the login page at the CURL level. Connections to SL Share will no longer redirect,
corrected for Facebook, Flickr and Twitter.
Diffstat (limited to 'indra/newview/llfacebookconnect.cpp')
-rwxr-xr-x | indra/newview/llfacebookconnect.cpp | 18 |
1 files changed, 15 insertions, 3 deletions
diff --git a/indra/newview/llfacebookconnect.cpp b/indra/newview/llfacebookconnect.cpp index a295910379..29c5d0c673 100755 --- a/indra/newview/llfacebookconnect.cpp +++ b/indra/newview/llfacebookconnect.cpp @@ -144,6 +144,7 @@ void LLFacebookConnect::facebookConnectCoro(LLCoros::self& self, std::string aut } httpOpts->setWantHeaders(true); + httpOpts->setFollowRedirects(false); setConnectionState(LLFacebookConnect::FB_CONNECTION_IN_PROGRESS); @@ -220,6 +221,7 @@ void LLFacebookConnect::facebookShareCoro(LLCoros::self& self, std::string route LLCore::HttpOptions::ptr_t httpOpts(new LLCore::HttpOptions, false); httpOpts->setWantHeaders(true); + httpOpts->setFollowRedirects(false); setConnectionState(LLFacebookConnect::FB_POSTING); @@ -243,6 +245,7 @@ void LLFacebookConnect::facebookShareImageCoro(LLCoros::self& self, std::string LLCore::HttpOptions::ptr_t httpOpts(new LLCore::HttpOptions, false); httpOpts->setWantHeaders(true); + httpOpts->setFollowRedirects(false); std::string imageFormat; if (dynamic_cast<LLImagePNG*>(image.get())) @@ -307,10 +310,12 @@ void LLFacebookConnect::facebookDisconnectCoro(LLCoros::self& self) LLCoreHttpUtil::HttpCoroutineAdapter::ptr_t httpAdapter(new LLCoreHttpUtil::HttpCoroutineAdapter("FacebookConnect", httpPolicy)); LLCore::HttpRequest::ptr_t httpRequest(new LLCore::HttpRequest); + LLCore::HttpOptions::ptr_t httpOpts(new LLCore::HttpOptions, false); setConnectionState(LLFacebookConnect::FB_DISCONNECTING); + httpOpts->setFollowRedirects(false); - LLSD result = httpAdapter->deleteAndYield(self, httpRequest, getFacebookConnectURL("/connection")); + LLSD result = httpAdapter->deleteAndYield(self, httpRequest, getFacebookConnectURL("/connection"), httpOpts); LLSD httpResults = result[LLCoreHttpUtil::HttpCoroutineAdapter::HTTP_RESULTS]; LLCore::HttpStatus status = LLCoreHttpUtil::HttpCoroutineAdapter::getStatusFromLLSD(httpResults); @@ -340,10 +345,13 @@ void LLFacebookConnect::facebookConnectedCheckCoro(LLCoros::self& self, bool aut LLCoreHttpUtil::HttpCoroutineAdapter::ptr_t httpAdapter(new LLCoreHttpUtil::HttpCoroutineAdapter("FacebookConnect", httpPolicy)); LLCore::HttpRequest::ptr_t httpRequest(new LLCore::HttpRequest); + LLCore::HttpOptions::ptr_t httpOpts(new LLCore::HttpOptions, false); setConnectionState(LLFacebookConnect::FB_CONNECTION_IN_PROGRESS); - LLSD result = httpAdapter->getAndYield(self, httpRequest, getFacebookConnectURL("/connection", true)); + httpOpts->setFollowRedirects(false); + + LLSD result = httpAdapter->getAndYield(self, httpRequest, getFacebookConnectURL("/connection", true), httpOpts); LLSD httpResults = result[LLCoreHttpUtil::HttpCoroutineAdapter::HTTP_RESULTS]; LLCore::HttpStatus status = LLCoreHttpUtil::HttpCoroutineAdapter::getStatusFromLLSD(httpResults); @@ -389,6 +397,7 @@ void LLFacebookConnect::facebookConnectInfoCoro(LLCoros::self& self) LLCore::HttpOptions::ptr_t httpOpts(new LLCore::HttpOptions, false); httpOpts->setWantHeaders(true); + httpOpts->setFollowRedirects(false); LLSD result = httpAdapter->getAndYield(self, httpRequest, getFacebookConnectURL("/info", true), httpOpts); @@ -429,8 +438,11 @@ void LLFacebookConnect::facebookConnectFriendsCoro(LLCoros::self& self) LLCoreHttpUtil::HttpCoroutineAdapter::ptr_t httpAdapter(new LLCoreHttpUtil::HttpCoroutineAdapter("FacebookConnect", httpPolicy)); LLCore::HttpRequest::ptr_t httpRequest(new LLCore::HttpRequest); + LLCore::HttpOptions::ptr_t httpOpts(new LLCore::HttpOptions, false); + + httpOpts->setFollowRedirects(false); - LLSD result = httpAdapter->getAndYield(self, httpRequest, getFacebookConnectURL("/friends", true)); + LLSD result = httpAdapter->getAndYield(self, httpRequest, getFacebookConnectURL("/friends", true), httpOpts); LLSD httpResults = result[LLCoreHttpUtil::HttpCoroutineAdapter::HTTP_RESULTS]; LLCore::HttpStatus status = LLCoreHttpUtil::HttpCoroutineAdapter::getStatusFromLLSD(httpResults); |