Caldav: fix bug 2896135, iCal login fails at iCal startup

git-svn-id: http://svn.code.sf.net/p/davmail/code/trunk@895 3d1905a2-6b24-0410-a738-b14d5a86fcbd
This commit is contained in:
mguessan 2009-12-22 21:47:43 +00:00
parent f4f472ed27
commit 3f22413dda
1 changed files with 14 additions and 12 deletions

View File

@ -996,6 +996,7 @@ public class CaldavConnection extends AbstractConnection {
*/
public void sendHttpResponse(int status, Map<String, String> headers, String contentType, byte[] content, boolean keepAlive) throws IOException {
sendClient("HTTP/1.1 " + status + ' ' + HttpStatus.getStatusText(status));
if (status != HttpStatus.SC_UNAUTHORIZED) {
String version = DavGateway.getCurrentVersion();
sendClient("Server: DavMail Gateway " + (version == null ? "" : version));
sendClient("DAV: 1, calendar-access, calendar-schedule, calendarserver-private-events");
@ -1006,6 +1007,7 @@ public class CaldavConnection extends AbstractConnection {
sendClient("Date: " + now);
sendClient("Expires: " + now);
sendClient("Cache-Control: private, max-age=0");
}
if (headers != null) {
for (Map.Entry<String, String> header : headers.entrySet()) {
sendClient(header.getKey() + ": " + header.getValue());