diff options
| author | dolphin <dolphin@lindenlab.com> | 2013-10-25 09:52:31 -0700 |
|---|---|---|
| committer | dolphin <dolphin@lindenlab.com> | 2013-10-25 09:52:31 -0700 |
| commit | 7bbb802385e58b1f9c2e7b04ad2f3f20c125be44 (patch) | |
| tree | 88ccb7d4cc17bb9615ee61ef001f8cb8963252fb /indra/llmessage/llurlrequest.cpp | |
| parent | a6faeac94530e59d2c2a56df63a1d78e00fb0247 (diff) | |
| parent | ea1e1b0925b386cf83178539b8eae9e25c573548 (diff) | |
Merge with 3.6.9
Diffstat (limited to 'indra/llmessage/llurlrequest.cpp')
| -rwxr-xr-x | indra/llmessage/llurlrequest.cpp | 21 |
1 files changed, 15 insertions, 6 deletions
diff --git a/indra/llmessage/llurlrequest.cpp b/indra/llmessage/llurlrequest.cpp index de9e2fe294..683065357d 100755 --- 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, ""); |
