Monotone-Parent: 41663dd56ce370b47da06520cdf3f63f55b42cb6

Monotone-Revision: 678f408cc158a19d36fc3c0d6f53b3434a652542

Monotone-Author: wsourdeau@inverse.ca
Monotone-Date: 2007-09-11T19:34:52
Monotone-Branch: ca.inverse.sogo
This commit is contained in:
Wolfgang Sourdeau
2007-09-11 19:34:52 +00:00
parent e1f063f50c
commit ee7859f87e
3 changed files with 27 additions and 2 deletions
+2
View File
@@ -30,6 +30,8 @@
@interface WODirectAction (SOGoExtension)
- (WOResponse *) responseWithStatus: (unsigned int) status;
- (WOResponse *) responseWith204;
- (WOResponse *) redirectToLocation: (NSString *) newLocation;
@end
+17 -2
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