From: Jay Freeman (saurik) Date: Tue, 22 Apr 2008 03:59:35 +0000 (+0000) Subject: Added support for 301 redirects to the new APT Apple HTTP method. X-Git-Url: https://git.saurik.com/apt-legacy.git/commitdiff_plain/415938a5dcf5431aa05d9cba345eb0c3a8c96e60?ds=sidebyside Added support for 301 redirects to the new APT Apple HTTP method. M cfnetwork.diff git-svn-id: http://svn.telesphoreo.org/trunk@229 514c082c-b64e-11dc-b46d-3d985efe055d --- diff --git a/methods/http.cc b/methods/http.cc index 2cca8b8..c990dfe 100644 --- a/methods/http.cc +++ b/methods/http.cc @@ -1196,7 +1196,7 @@ int HttpMethod::Loop() hm = (CFHTTPMessageRef) CFReadStreamCopyProperty(rs, kCFStreamPropertyHTTPResponseHeader); sc = CFHTTPMessageGetResponseStatusCode(hm); - if (sc == 302) { + if (sc == 301 || sc == 302) { sr = CFHTTPMessageCopyHeaderFieldValue(hm, CFSTR("Location")); if (sr == NULL) { Fail(); diff --git a/methods/http.cc.orig b/methods/http.cc.orig index 27454b9..0f01d38 100644 --- a/methods/http.cc.orig +++ b/methods/http.cc.orig @@ -1192,7 +1192,7 @@ int HttpMethod::Loop() hm = (CFHTTPMessageRef) CFReadStreamCopyProperty(rs, kCFStreamPropertyHTTPResponseHeader); sc = CFHTTPMessageGetResponseStatusCode(hm); - if (sc == 302) { + if (sc == 301 || sc == 302) { sr = CFHTTPMessageCopyHeaderFieldValue(hm, CFSTR("Location")); if (sr == NULL) { Fail();