Last Comment Bug 396515 - ICS provider should use Accept: text/calendar on GET
: ICS provider should use Accept: text/calendar on GET
[good first bug][lang=js]
Product: Calendar
Classification: Client Software
Component: Provider: ICS/WebDAV (show other bugs)
: unspecified
: All All
-- normal (vote)
Assigned To: Malintha Fernando [:marlio]
Mentors: Philipp Kewisch [:Fallen]
Depends on:
  Show dependency treegraph
Reported: 2007-09-17 20:36 PDT by Bruno Browning
Modified: 2015-02-18 12:36 PST (History)
6 users (show)
See Also:
Crash Signature:
QA Whiteboard:
Iteration: ---
Points: ---

set headers (1.24 KB, patch)
2007-09-18 05:40 PDT, Bruno Browning
no flags Details | Diff | Splinter Review
patch rev 2 (1.93 KB, patch)
2008-09-28 08:01 PDT, Bruno Browning
dbo.moz: review-
Details | Diff | Splinter Review
AcceptHeaders_V1.patch (667 bytes, patch)
2015-02-17 11:49 PST, Malintha Fernando [:marlio]
philipp: review+
Details | Diff | Splinter Review
AcceptHeaders.patch (816 bytes, patch)
2015-02-17 12:12 PST, Malintha Fernando [:marlio]
aleth: review+
Details | Diff | Splinter Review

Description User image Bruno Browning 2007-09-17 20:36:38 PDT
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
Comment 1 User image Bruno Browning 2007-09-18 04:38:27 PDT
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.
Comment 2 User image Bruno Browning 2007-09-18 05:40:42 PDT
Created attachment 281300 [details] [diff] [review]
set headers

tested w/ http:// and file:///; I want to test against ftp:// before requesting review.
Comment 3 User image Gary Kwong [:gkw] [:nth10sd] 2008-02-25 08:05:50 PST
Bruno, could you please provide an update on the status of this patch/bug?
Comment 4 User image Martin Schröder [:mschroeder] 2008-05-01 08:26:21 PDT
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?
Comment 5 User image Bernard Desruisseaux 2008-05-01 08:39:40 PDT
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".

Comment 6 User image Bruno Browning 2008-09-28 08:01:27 PDT
Created attachment 340799 [details] [diff] [review]
patch rev 2
Comment 7 User image Daniel Boelzle [:dbo] 2008-09-29 05:52:55 PDT
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[";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.
Comment 8 User image Philipp Kewisch [:Fallen] 2011-11-11 02:29:10 PST
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.
Comment 9 User image Bernard Desruisseaux 2011-11-11 05:46:58 PST

How about using the following?

Accept: text/calendar,text/plain;q=0.8,*/*;q=0.5
Comment 10 User image Philipp Kewisch [:Fallen] 2011-11-13 03:39:56 PST
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 ;-)
Comment 11 User image Malintha Fernando [:marlio] 2015-02-17 11:49:36 PST
Created attachment 8565562 [details] [diff] [review]
Comment 12 User image Philipp Kewisch [:Fallen] 2015-02-17 11:54:57 PST
Comment on attachment 8565562 [details] [diff] [review]

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

Looks good, r=philipp
Comment 13 User image Malintha Fernando [:marlio] 2015-02-17 12:12:23 PST
Created attachment 8565578 [details] [diff] [review]

Adding patch headers
Comment 14 User image aleth [:aleth] 2015-02-18 12:32:10 PST
Comment on attachment 8565578 [details] [diff] [review]

Please mark r- patches as obsolete and patches to be checked in as r+ in the future. That makes handling checkin-needed easier. Thanks!

Note You need to log in before you can comment on or make changes to this bug.