summaryrefslogtreecommitdiff
path: root/indra/llmessage/llurlrequest.cpp
diff options
context:
space:
mode:
authorDon Kjer <don@lindenlab.com>2013-05-08 05:51:28 +0000
committerDon Kjer <don@lindenlab.com>2013-05-08 05:51:28 +0000
commit3a351c4ee548e2bce8ad0d5935377a090591621f (patch)
treea1e0987e75e9f02071b29539a5423a94714f5366 /indra/llmessage/llurlrequest.cpp
parent7223f016469ecaacedb841ea435207c4266269e8 (diff)
Adding follow_redirects parameter to LLHTTPClient get/head variants. Not following redirects for facebook connect requests.
Diffstat (limited to 'indra/llmessage/llurlrequest.cpp')
-rw-r--r--indra/llmessage/llurlrequest.cpp21
1 files changed, 15 insertions, 6 deletions
diff --git a/indra/llmessage/llurlrequest.cpp b/indra/llmessage/llurlrequest.cpp
index 627d591839..49f8144ee7 100644
--- a/indra/llmessage/llurlrequest.cpp
+++ b/indra/llmessage/llurlrequest.cpp
@@ -150,16 +150,19 @@ std::string LLURLRequest::actionAsVerb(LLURLRequest::ERequestAction action)
return VERBS[action];
}
-LLURLRequest::LLURLRequest(LLURLRequest::ERequestAction action) :
- mAction(action)
+LLURLRequest::LLURLRequest(LLURLRequest::ERequestAction action, bool follow_redirects /* = true */) :
+ mAction(action),
+ mFollowRedirects(follow_redirects)
{
initialize();
}
LLURLRequest::LLURLRequest(
LLURLRequest::ERequestAction action,
- const std::string& url) :
- mAction(action)
+ const std::string& url,
+ bool follow_redirects /* = true */) :
+ mAction(action),
+ mFollowRedirects(follow_redirects)
{
initialize();
setURL(url);
@@ -479,12 +482,18 @@ bool LLURLRequest::configure()
case HTTP_HEAD:
mDetail->mCurlRequest->setopt(CURLOPT_HEADER, 1);
mDetail->mCurlRequest->setopt(CURLOPT_NOBODY, 1);
- mDetail->mCurlRequest->setopt(CURLOPT_FOLLOWLOCATION, 1);
+ if (mFollowRedirects)
+ {
+ mDetail->mCurlRequest->setopt(CURLOPT_FOLLOWLOCATION, 1);
+ }
rv = true;
break;
case HTTP_GET:
mDetail->mCurlRequest->setopt(CURLOPT_HTTPGET, 1);
- mDetail->mCurlRequest->setopt(CURLOPT_FOLLOWLOCATION, 1);
+ if (mFollowRedirects)
+ {
+ mDetail->mCurlRequest->setopt(CURLOPT_FOLLOWLOCATION, 1);
+ }
// Set Accept-Encoding to allow response compression
mDetail->mCurlRequest->setoptString(CURLOPT_ENCODING, "");