mirror of
https://github.com/inverse-inc/sogo.git
synced 2026-11-11 11:21:33 +00:00
#3120: prevent webcalendar to reveal endpoint nature
This commit is contained in:
1 parent
7abcf08ba1
commit
c9d121afdb
2 files changed
+15
-10
No files matched your search
@@ -155,19 +155,21 @@
|
||||
httpCode = 200;
|
||||
results = [[self clientObject] loadWebCalendar];
|
||||
|
||||
|
||||
if ([results objectForKey: @"status"])
|
||||
{
|
||||
if ([results objectForKey: @"error"])
|
||||
// Don't reveal how the remote host answered (connection error, HTTP error
|
||||
// or non-calendar content): all failures except a required authentication
|
||||
// return the same response. Details are kept in the server log.
|
||||
error = [results objectForKey: @"error"];
|
||||
if (error)
|
||||
{
|
||||
error = [results objectForKey: @"error"];
|
||||
if ([error isEqualToString: @"need-auth"])
|
||||
httpCode = 401;
|
||||
if ([error isEqualToString: @"invalid-calendar-content"] || [error isEqualToString: @"http-error"])
|
||||
httpCode = 500;
|
||||
else
|
||||
{
|
||||
httpCode = 500;
|
||||
[results setObject: @"bad-url" forKey: @"error"];
|
||||
}
|
||||
}
|
||||
[results removeObjectForKey:@"status"];
|
||||
}
|
||||
[results removeObjectForKey: @"status"];
|
||||
|
||||
return [self responseWithStatus: httpCode andJSONRepresentation: results];
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user