From: helge Date: Tue, 20 Nov 2007 11:46:48 +0000 (+0000) Subject: added redirect locations X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=b1227d3b992e4416c8aa79da4e39e660b79d2b19;p=sope added redirect locations git-svn-id: http://svn.opengroupware.org/SOPE/trunk@1548 e4a50df8-12e2-0310-a44c-efbce7f8a7e3 --- diff --git a/sope-appserver/NGXmlRpc/ChangeLog b/sope-appserver/NGXmlRpc/ChangeLog index 44120b43..e82e1d6b 100644 --- a/sope-appserver/NGXmlRpc/ChangeLog +++ b/sope-appserver/NGXmlRpc/ChangeLog @@ -1,3 +1,7 @@ +2007-11-20 Helge Hess + + * NGXmlRpcClient.m: add redirect locations to error reason (v4.7.17) + 2007-02-12 Helge Hess * NGXmlRpcClient.m: fixed a gnustep-base compilation warning (v4.7.16) diff --git a/sope-appserver/NGXmlRpc/NGXmlRpcClient.m b/sope-appserver/NGXmlRpc/NGXmlRpcClient.m index 4d1fc810..a645ea32 100644 --- a/sope-appserver/NGXmlRpc/NGXmlRpcClient.m +++ b/sope-appserver/NGXmlRpc/NGXmlRpcClient.m @@ -274,6 +274,7 @@ NSException *exc; NSString *r; NSDictionary *ui; + int status; #if 0 NSLog(@"%s: XML-RPC response status: %i", __PRETTY_FUNCTION__, @@ -282,13 +283,19 @@ /* construct exception */ + status = [_response status]; r = [NSString stringWithFormat:@"call failed with HTTP status code %i", - [_response status]]; + status]; + if (status == 301 || status == 302) { + NSString *l = [_response headerForKey:@"location"]; + if ([l isNotEmpty]) + r = [NSString stringWithFormat:@"%@ [location=%@]", r, l]; + } ui = [NSDictionary dictionaryWithObjectsAndKeys: self, @"NGXmlRpcClient", _response, @"WOResponse", - [NSNumber numberWithInt:[_response status]], + [NSNumber numberWithInt:status], @"HTTPStatusCode", nil]; diff --git a/sope-appserver/NGXmlRpc/Version b/sope-appserver/NGXmlRpc/Version index 0a8bca08..3c3eedfd 100644 --- a/sope-appserver/NGXmlRpc/Version +++ b/sope-appserver/NGXmlRpc/Version @@ -1,3 +1,3 @@ # version file -SUBMINOR_VERSION:=16 +SUBMINOR_VERSION:=17