bug 311263 - Adds UTF-8 request headers for CalDAV. Patch by Bruno Browning <browning@uwalumni.com> r=ctalbert,mvl NPOTDB

git-svn-id: svn://10.0.0.236/trunk@216365 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
mattwillis%gmail.com 2006-12-03 18:40:05 +00:00
parent d24dec84e8
commit 17d511cef4
2 changed files with 12 additions and 2 deletions

View File

@ -295,7 +295,7 @@ calDavCalendar.prototype = {
// do WebDAV put
var webSvc = Components.classes['@mozilla.org/webdav/service;1']
.getService(Components.interfaces.nsIWebDAVService);
webSvc.putFromString(eventResource, "text/calendar",
webSvc.putFromString(eventResource, "text/calendar; charset=utf-8",
aItem.icalString, listener, this, null);
return;
@ -425,7 +425,7 @@ calDavCalendar.prototype = {
LOG("modifyItem: aNewItem.icalString = " + aNewItem.icalString);
var webSvc = Components.classes['@mozilla.org/webdav/service;1']
.getService(Components.interfaces.nsIWebDAVService);
webSvc.putFromString(eventResource, "text/calendar",
webSvc.putFromString(eventResource, "text/calendar; charset=utf-8",
modifiedItemICS, listener, this, null);
return;

View File

@ -191,6 +191,16 @@ nsWebDAVService::SendDocumentToChannel(nsIDocument *doc,
NS_ENSURE_SUCCESS(rv, rv);
channel->SetRequestMethod(nsDependentCString(method));
channel->SetRequestHeader(NS_LITERAL_CSTRING("Content-Type"),
NS_LITERAL_CSTRING("text/xml; charset=utf-8"),
PR_FALSE);
channel->SetRequestHeader(NS_LITERAL_CSTRING("Accept"),
NS_LITERAL_CSTRING("text/xml"),
PR_FALSE);
channel->SetRequestHeader(NS_LITERAL_CSTRING("Accept-Charset"),
NS_LITERAL_CSTRING("utf-8,*;q=0.1"),
PR_FALSE);
if (withDepth) {
channel->SetRequestHeader(NS_LITERAL_CSTRING("Depth"),