mirror of
https://github.com/inverse-inc/sogo.git
synced 2026-08-30 18:57:18 +00:00
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:
@@ -30,6 +30,8 @@
|
||||
|
||||
@interface WODirectAction (SOGoExtension)
|
||||
|
||||
- (WOResponse *) responseWithStatus: (unsigned int) status;
|
||||
- (WOResponse *) responseWith204;
|
||||
- (WOResponse *) redirectToLocation: (NSString *) newLocation;
|
||||
|
||||
@end
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user