Monotone-Parent: 41663dd56ce370b47da06520cdf3f63f55b42cb6

Monotone-Revision: 678f408cc158a19d36fc3c0d6f53b3434a652542

Monotone-Author: wsourdeau@inverse.ca
Monotone-Date: 2007-09-11T19:34:52
Monotone-Branch: ca.inverse.sogo
maint-2.0.2
Wolfgang Sourdeau 2007-09-11 19:34:52 +00:00
parent e1f063f50c
commit ee7859f87e
3 changed files with 27 additions and 2 deletions

View File

@ -1,5 +1,13 @@
2007-09-11 Wolfgang Sourdeau <wsourdeau@inverse.ca>
* UI/Common/WODirectAction+SOGo.m ([WODirectAction
-responseWithStatus:status]): new method that returns a WOResponse
initialized with the specified status code.
([WODirectAction -responseWith204]): new method that invokes the
above one with "204" as parameter.
([WODirectAction -redirectToLocation:newLocation]): rewrote method
to make use of -responseWithStatus:.
* UI/SOGoUI/UIxComponent.m ([UIxComponent -responseWith204]): new
method that returns a WOResponse initialized with the 204 status
code.

View File

@ -30,6 +30,8 @@
@interface WODirectAction (SOGoExtension)
- (WOResponse *) responseWithStatus: (unsigned int) status;
- (WOResponse *) responseWith204;
- (WOResponse *) redirectToLocation: (NSString *) newLocation;
@end

View File

@ -28,15 +28,30 @@
@implementation WODirectAction (SOGoExtension)
- (WOResponse *) redirectToLocation: (NSString *) newLocation
- (WOResponse *) responseWithStatus: (unsigned int) status
{
WOResponse *response;
response = [context response];
[response setStatus: 302 /* moved */];
[response setStatus: status];
return response;
}
- (WOResponse *) responseWith204
{
return [self responseWithStatus: 204];
}
- (WOResponse *) redirectToLocation: (NSString *) newLocation
{
WOResponse *response;
response = [self responseWithStatus: 302];
[response setHeader: newLocation forKey: @"location"];
return response;
}
@end