fix(dav): render DAV exceptions as XML

This commit is contained in:
Francis Lachapelle
2022-02-01 14:20:32 -05:00
parent 348a79c795
commit 96bb8b4cc2
10 changed files with 87 additions and 67 deletions
+20 -1
View File
@@ -1,7 +1,7 @@
/* SOGoObject.m - this file is part of SOGo
*
* Copyright (C) 2004-2005 SKYRIX Software AG
* Copyright (C) 2006-2015 Inverse inc.
* Copyright (C) 2006-2022 Inverse inc.
*
* This file is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -1594,4 +1594,23 @@
return [self labelForKey: key inContext: context];
}
- (id) exceptionWithHTTPStatus: (unsigned short) theStatus
{
if ([[context request] handledByDefaultHandler])
return [NSException exceptionWithHTTPStatus: theStatus];
else
return [NSException exceptionWithDAVStatus: theStatus];
}
- (id) exceptionWithHTTPStatus: (unsigned short) theStatus
reason: (NSString *) theReason
{
if ([[context request] handledByDefaultHandler])
return [NSException exceptionWithHTTPStatus: theStatus
reason: theReason];
else
return [NSException exceptionWithDAVStatus: theStatus
reason: theReason];
}
@end /* SOGoObject */