mirror of
https://github.com/moparisthebest/davmail
synced 2025-01-13 14:38:08 -05:00
Caldav: Improve principal error handling
git-svn-id: http://svn.code.sf.net/p/davmail/code/trunk@467 3d1905a2-6b24-0410-a738-b14d5a86fcbd
This commit is contained in:
parent
0410b144d9
commit
6726a464fb
@ -529,6 +529,11 @@ public class CaldavConnection extends AbstractConnection {
|
||||
actualPrincipal = session.getEmail();
|
||||
}
|
||||
|
||||
if (!session.getEmail().equals(principal)) {
|
||||
String message = "Invalid principal path, try /principals/users/" + session.getEmail();
|
||||
DavGatewayTray.error(message);
|
||||
sendErr(HttpStatus.SC_NOT_FOUND, message);
|
||||
} else {
|
||||
CaldavResponse response = new CaldavResponse(HttpStatus.SC_MULTI_STATUS);
|
||||
response.startMultistatus();
|
||||
response.startResponse("/principals/users/" + principal);
|
||||
@ -561,6 +566,7 @@ public class CaldavConnection extends AbstractConnection {
|
||||
response.endMultistatus();
|
||||
response.close();
|
||||
}
|
||||
}
|
||||
|
||||
public void sendFreeBusy(String body) throws IOException {
|
||||
HashMap<String, String> valueMap = new HashMap<String, String>();
|
||||
@ -832,8 +838,9 @@ public class CaldavConnection extends AbstractConnection {
|
||||
public void write(int b) throws IOException {
|
||||
throw new UnsupportedOperationException();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void close() throws IOException{
|
||||
public void close() throws IOException {
|
||||
sendClient("0");
|
||||
sendClient("");
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user