diff options
| author | Merov Linden <merov@lindenlab.com> | 2013-05-08 14:37:37 -0700 |
|---|---|---|
| committer | Merov Linden <merov@lindenlab.com> | 2013-05-08 14:37:37 -0700 |
| commit | bd482ab55e30403438aed2fc19200eae36efc96a (patch) | |
| tree | bb7aa9f5f460ffc540ccc16b6436227e05d3dc3b /indra/llmessage/llurlrequest.cpp | |
| parent | 54de882b81083298009e3b4a3d74fa1c7255068d (diff) | |
| parent | 7d6e3945204c05efe85eadf8a6635d0ca30e9186 (diff) | |
Pull merge from viewer-fbc
Diffstat (limited to 'indra/llmessage/llurlrequest.cpp')
| -rw-r--r-- | 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 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, ""); |
