summaryrefslogtreecommitdiffstats
path: root/lib/utils
diff options
context:
space:
mode:
authorDenys Vlasenko <dvlasenk@redhat.com>2010-08-24 13:08:52 +0200
committerDenys Vlasenko <dvlasenk@redhat.com>2010-08-24 13:08:52 +0200
commit8ea8b95984058f6469bf813746f1d7472300aa4d (patch)
treef2e0cc13f29801887f7608bc9124a8c58ab2f737 /lib/utils
parent5cc439c2c24859accf8a94d8a91879ad6d967ea4 (diff)
fix 305 redirect problem
Signed-off-by: Denys Vlasenko <dvlasenk@redhat.com>
Diffstat (limited to 'lib/utils')
-rw-r--r--lib/utils/abrt_curl.cpp8
-rw-r--r--lib/utils/abrt_rh_support.cpp2
2 files changed, 9 insertions, 1 deletions
diff --git a/lib/utils/abrt_curl.cpp b/lib/utils/abrt_curl.cpp
index 52688ac1..a836f704 100644
--- a/lib/utils/abrt_curl.cpp
+++ b/lib/utils/abrt_curl.cpp
@@ -303,6 +303,11 @@ abrt_post(abrt_post_state_t *state,
xcurl_easy_setopt_ptr(handle, CURLOPT_HTTPHEADER, httpheader_list);
}
+// Disabled: was observed to also handle "305 Use proxy" redirect,
+// apparently with POST->GET remapping - which server didn't like at all.
+// Attempted to suppress remapping on 305 using CURLOPT_POSTREDIR of -1,
+// but it still did not work.
+#if 0
// Please handle 301/302 redirects for me
xcurl_easy_setopt_long(handle, CURLOPT_FOLLOWLOCATION, 1);
xcurl_easy_setopt_long(handle, CURLOPT_MAXREDIRS, 10);
@@ -315,7 +320,8 @@ abrt_post(abrt_post_state_t *state,
// The non-RFC behaviour is ubiquitous in web browsers, so the library
// does the conversion by default to maintain consistency.
// However, a server may require a POST to remain a POST.
- //xcurl_easy_setopt_long(CURLOPT_POSTREDIR, CURL_REDIR_POST_ALL);
+ xcurl_easy_setopt_long(handle, CURLOPT_POSTREDIR, -1L /*CURL_REDIR_POST_ALL*/ );
+#endif
// Prepare for saving information
if (state->flags & ABRT_POST_WANT_HEADERS)
diff --git a/lib/utils/abrt_rh_support.cpp b/lib/utils/abrt_rh_support.cpp
index 4a1d80f0..fd78a427 100644
--- a/lib/utils/abrt_rh_support.cpp
+++ b/lib/utils/abrt_rh_support.cpp
@@ -397,6 +397,8 @@ send_report_to_new_case(const char* baseURL,
char *case_location = find_header_in_abrt_post_state(case_state, "Location:");
switch (case_state->http_resp_code)
{
+ case 301: /* "301 Moved Permanently" (for example, used to move http:// to https://) */
+ case 302: /* "302 Found" (just in case) */
case 305: /* "305 Use Proxy" */
if (++redirect_count < 10 && case_location)
{