Closed Bug 396515 Opened 17 years ago Closed 9 years ago

ICS provider should use Accept: text/calendar on GET

Categories

(Calendar :: Provider: ICS/WebDAV, defect)

defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED
4.0.0.1

People

(Reporter: browning, Assigned: marlio, Mentored)

Details

(Whiteboard: [good first bug][lang=js])

Attachments

(1 file, 3 obsolete files)

In an email of 14 September bernard at oracle requested:

For calendars configured "On the Network" in Format
   "iCalendar (ICS)" Lightning issue an HTTP GET request
   with the following request header:

      Accept: text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5

   Could Lightning specify the following value instead?

      Accept: text/calendar
Taking this. The Accept: header probably should actually be "text/calendar; charset=utf-8", and we should properly set the Accept-Charset: header as well.
Status: NEW → ASSIGNED
Assignee: nobody → browning
Status: ASSIGNED → NEW
Attached patch set headers (obsolete) — — Splinter Review
tested w/ http:// and file:///; I want to test against ftp:// before requesting review.
Bruno, could you please provide an update on the status of this patch/bug?
Bruno, do you want to ask for review for the patch? Do we need the "; charset=utf-8" part if we specify a separate Accept-Charset header?
Status: NEW → ASSIGNED
OS: Linux → All
Hardware: PC → All
Actually, you can't specify ";charset=utf-8" in the Accept request header.
The semi-colon is used to separate the "media-range" from the "accept-params".
See: http://tools.ietf.org/html/rfc2616#section-14.1

Thanks!
Bernard
Attached patch patch rev 2 (obsolete) — — Splinter Review
Attachment #340799 - Flags: review?(daniel.boelzle)
Comment on attachment 340799 [details] [diff] [review]
patch rev 2

>-        channel.loadFlags |= Components.interfaces.nsIRequest.LOAD_BYPASS_CACHE;
>-        channel.notificationCallbacks = this;
>+        this.prepareChannel(channel);
> 
>         var downloader = Components.classes["@mozilla.org/network/downloader;1"]
>                                    .createInstance(CI.nsIDownloader);
...

This will add the etag check to the backup download, but I don't see 304 handled in that code. As far as I see this may lead to empty backups.
Attachment #340799 - Flags: review?(daniel.boelzle) → review-
Attachment #281300 - Attachment is obsolete: true
Bernard, is this still an issue? Requesting text/calendar might be more correct, but for servers that serve such files as text/plain we break interop.
Philipp,

How about using the following?

Accept: text/calendar,text/plain;q=0.8,*/*;q=0.5
Sounds good to me. We'd have to find out what happens if there is no accepted content type and display the right kind of error. Now we just need someone to put up a patch ;-)
Whiteboard: [good first bug]
Assignee: browning → nobody
Mentor: philipp
Whiteboard: [good first bug] → [good first bug][lang=js]
Status: ASSIGNED → NEW
Attached patch AcceptHeaders_V1.patch (obsolete) — — Splinter Review
Attachment #8565562 - Flags: review?(philipp)
Comment on attachment 8565562 [details] [diff] [review]
AcceptHeaders_V1.patch

Review of attachment 8565562 [details] [diff] [review]:
-----------------------------------------------------------------

Looks good, r=philipp
Attachment #8565562 - Flags: review?(philipp) → review+
Assignee: nobody → malinthak2
Status: NEW → ASSIGNED
Attached patch AcceptHeaders.patch — — Splinter Review
Adding patch headers
Attachment #8565562 - Attachment is obsolete: true
Attachment #8565578 - Flags: checkin?(philipp)
Attachment #340799 - Attachment is obsolete: true
Comment on attachment 8565578 [details] [diff] [review]
AcceptHeaders.patch

Please mark r- patches as obsolete and patches to be checked in as r+ in the future. That makes handling checkin-needed easier. Thanks!
Attachment #8565578 - Flags: review+
Status: ASSIGNED → RESOLVED
Closed: 9 years ago
Keywords: checkin-needed
Resolution: --- → FIXED
Target Milestone: --- → 4.0
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: