summaryrefslogtreecommitdiff
path: root/indra/newview/llflickrconnect.cpp
diff options
context:
space:
mode:
authorRider Linden <rider@lindenlab.com>2015-06-17 14:41:28 -0700
committerRider Linden <rider@lindenlab.com>2015-06-17 14:41:28 -0700
commit82e34f1683f67b8394306b1569260508a213b99e (patch)
tree7bdd15eeab42de095d68c775db59b5ccf6e257c8 /indra/newview/llflickrconnect.cpp
parent4a4470af3210153e0909eb75d51de461d14a3128 (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/llflickrconnect.cpp')
-rw-r--r--indra/newview/llflickrconnect.cpp23
1 files changed, 16 insertions, 7 deletions
diff --git a/indra/newview/llflickrconnect.cpp b/indra/newview/llflickrconnect.cpp
index b3c89b9798..4ec3344b48 100644
--- a/indra/newview/llflickrconnect.cpp
+++ b/indra/newview/llflickrconnect.cpp
@@ -73,9 +73,10 @@ void LLFlickrConnect::flickrConnectCoro(LLCoros::self& self, std::string request
LLCoreHttpUtil::HttpCoroutineAdapter::ptr_t
httpAdapter(new LLCoreHttpUtil::HttpCoroutineAdapter("FlickrConnect", httpPolicy));
LLCore::HttpRequest::ptr_t httpRequest(new LLCore::HttpRequest);
- LLCore::HttpOptions::ptr_t httpOpts(new LLCore::HttpOptions);
+ LLCore::HttpOptions::ptr_t httpOpts(new LLCore::HttpOptions, false);
httpOpts->setWantHeaders(true);
+ httpOpts->setFollowRedirects(false);
LLSD body;
if (!requestToken.empty())
@@ -162,9 +163,10 @@ void LLFlickrConnect::flickrShareCoro(LLCoros::self& self, LLSD share)
LLCoreHttpUtil::HttpCoroutineAdapter::ptr_t
httpAdapter(new LLCoreHttpUtil::HttpCoroutineAdapter("FlickrConnect", httpPolicy));
LLCore::HttpRequest::ptr_t httpRequest(new LLCore::HttpRequest);
- LLCore::HttpOptions::ptr_t httpOpts(new LLCore::HttpOptions);
+ LLCore::HttpOptions::ptr_t httpOpts(new LLCore::HttpOptions, false);
httpOpts->setWantHeaders(true);
+ httpOpts->setFollowRedirects(false);
setConnectionState(LLFlickrConnect::FLICKR_POSTING);
@@ -185,10 +187,11 @@ void LLFlickrConnect::flickrShareImageCoro(LLCoros::self& self, LLPointer<LLImag
LLCoreHttpUtil::HttpCoroutineAdapter::ptr_t
httpAdapter(new LLCoreHttpUtil::HttpCoroutineAdapter("FlickrConnect", httpPolicy));
LLCore::HttpRequest::ptr_t httpRequest(new LLCore::HttpRequest);
- LLCore::HttpHeaders::ptr_t httpHeaders(new LLCore::HttpHeaders);
- LLCore::HttpOptions::ptr_t httpOpts(new LLCore::HttpOptions);
+ LLCore::HttpHeaders::ptr_t httpHeaders(new LLCore::HttpHeaders, false);
+ LLCore::HttpOptions::ptr_t httpOpts(new LLCore::HttpOptions, false);
httpOpts->setWantHeaders(true);
+ httpOpts->setFollowRedirects(false);
std::string imageFormat;
if (dynamic_cast<LLImagePNG*>(image.get()))
@@ -263,10 +266,12 @@ void LLFlickrConnect::flickrDisconnectCoro(LLCoros::self& self)
LLCoreHttpUtil::HttpCoroutineAdapter::ptr_t
httpAdapter(new LLCoreHttpUtil::HttpCoroutineAdapter("FlickrConnect", httpPolicy));
LLCore::HttpRequest::ptr_t httpRequest(new LLCore::HttpRequest);
+ LLCore::HttpOptions::ptr_t httpOpts(new LLCore::HttpOptions, false);
setConnectionState(LLFlickrConnect::FLICKR_DISCONNECTING);
+ httpOpts->setFollowRedirects(false);
- LLSD result = httpAdapter->deleteAndYield(self, httpRequest, getFlickrConnectURL("/connection"));
+ LLSD result = httpAdapter->deleteAndYield(self, httpRequest, getFlickrConnectURL("/connection"), httpOpts);
LLSD httpResults = result[LLCoreHttpUtil::HttpCoroutineAdapter::HTTP_RESULTS];
LLCore::HttpStatus status = LLCoreHttpUtil::HttpCoroutineAdapter::getStatusFromLLSD(httpResults);
@@ -295,10 +300,13 @@ void LLFlickrConnect::flickrConnectedCoro(LLCoros::self& self, bool autoConnect)
LLCoreHttpUtil::HttpCoroutineAdapter::ptr_t
httpAdapter(new LLCoreHttpUtil::HttpCoroutineAdapter("FlickrConnect", httpPolicy));
LLCore::HttpRequest::ptr_t httpRequest(new LLCore::HttpRequest);
+ LLCore::HttpOptions::ptr_t httpOpts(new LLCore::HttpOptions, false);
setConnectionState(LLFlickrConnect::FLICKR_CONNECTION_IN_PROGRESS);
- LLSD result = httpAdapter->getAndYield(self, httpRequest, getFlickrConnectURL("/connection", true));
+ httpOpts->setFollowRedirects(false);
+
+ LLSD result = httpAdapter->getAndYield(self, httpRequest, getFlickrConnectURL("/connection", true), false);
LLSD httpResults = result[LLCoreHttpUtil::HttpCoroutineAdapter::HTTP_RESULTS];
LLCore::HttpStatus status = LLCoreHttpUtil::HttpCoroutineAdapter::getStatusFromLLSD(httpResults);
@@ -342,9 +350,10 @@ void LLFlickrConnect::flickrInfoCoro(LLCoros::self& self)
LLCoreHttpUtil::HttpCoroutineAdapter::ptr_t
httpAdapter(new LLCoreHttpUtil::HttpCoroutineAdapter("FlickrConnect", httpPolicy));
LLCore::HttpRequest::ptr_t httpRequest(new LLCore::HttpRequest);
- LLCore::HttpOptions::ptr_t httpOpts(new LLCore::HttpOptions);
+ LLCore::HttpOptions::ptr_t httpOpts(new LLCore::HttpOptions, false);
httpOpts->setWantHeaders(true);
+ httpOpts->setFollowRedirects(false);
LLSD result = httpAdapter->getAndYield(self, httpRequest, getFlickrConnectURL("/info", true), httpOpts);