From: helge Date: Wed, 13 Oct 2004 16:46:01 +0000 (+0000) Subject: fixed method handler for WOResponse client objects X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=1e78e85a95339bb0b92465ae5b459dbbbbeacbd3;p=sope fixed method handler for WOResponse client objects git-svn-id: http://svn.opengroupware.org/SOPE/trunk@251 e4a50df8-12e2-0310-a44c-efbce7f8a7e3 --- diff --git a/sope-appserver/NGObjWeb/ChangeLog b/sope-appserver/NGObjWeb/ChangeLog index d85374f3..5c0ca068 100644 --- a/sope-appserver/NGObjWeb/ChangeLog +++ b/sope-appserver/NGObjWeb/ChangeLog @@ -1,5 +1,9 @@ 2004-10-13 Helge Hess + * SoObjects/SoObjectMethodDispatcher.m: fixed an issue when the + clientObject is a WOResponse object. In this case, just return the + response instead of starting method processing (v4.3.66) + * DynamicElements/WOInput.m: minor code cleanups, be tolerant on missing value binding (previously printed a warning) (v4.3.65) diff --git a/sope-appserver/NGObjWeb/SoObjects/SoObjectMethodDispatcher.m b/sope-appserver/NGObjWeb/SoObjects/SoObjectMethodDispatcher.m index 3315f51f..a87293fd 100644 --- a/sope-appserver/NGObjWeb/SoObjects/SoObjectMethodDispatcher.m +++ b/sope-appserver/NGObjWeb/SoObjects/SoObjectMethodDispatcher.m @@ -71,15 +71,25 @@ static BOOL useRedirectsForDefaultMethods = NO; /* find client object */ - if ((clientObject = [_ctx clientObject])) { + if ((clientObject = [_ctx clientObject]) != nil) { if (debugOn) [self debugWithFormat:@"client object set in ctx: %@", clientObject]; } - else if ((clientObject = [self->object clientObject])) { + else if ((clientObject = [self->object clientObject]) != nil) { if (debugOn) [self debugWithFormat:@"setting client object: %@", clientObject]; [_ctx setClientObject:clientObject]; } + + /* check whether client object is a response ... */ + + if ([clientObject isKindOfClass:[WOResponse class]]) { + [self debugWithFormat:@"clientObject is a WOResponse, returning that: %@", + clientObject]; + resultObject = [clientObject retain]; + [pool release]; + return [resultObject autorelease]; + } // TODO: should check XML-RPC !!! // (hm, why ? XML-RPC is handled by other dispatcher ?) @@ -114,6 +124,9 @@ static BOOL useRedirectsForDefaultMethods = NO; if (![url hasSuffix:@"/"]) url = [url stringByAppendingString:@"/"]; url = [url stringByAppendingString:defaultName]; + [self debugWithFormat:@"redirect to default method %@ of %@: %@", + defaultName, self->object, url]; + r = [[_ctx response] retain]; [r setStatus:302 /* moved */]; [r setHeader:url forKey:@"location"]; diff --git a/sope-appserver/NGObjWeb/Version b/sope-appserver/NGObjWeb/Version index 57118e1b..169c13e0 100644 --- a/sope-appserver/NGObjWeb/Version +++ b/sope-appserver/NGObjWeb/Version @@ -1,6 +1,6 @@ # version file -SUBMINOR_VERSION:=65 +SUBMINOR_VERSION:=66 # v4.3.42 requires libNGExtensions v4.3.116 # v4.3.40 requires libNGExtensions v4.3.115