Closed Bug 1449269 Opened 2 years ago Closed 2 years ago

CalDAV OPTIONS request doesn't handle 204 (or other 2xx) No Content in checkServerCaps

Categories

(Calendar :: Provider: CalDAV, defect)

defect
Not set

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: andri, Assigned: MakeMyDay)

Details

Attachments

(1 file)

User Agent: Mozilla/5.0 (X11; Linux x86_64; rv:59.0) Gecko/20100101 Firefox/59.0
Build ID: 20180327042013

Steps to reproduce:

The CalDAV calendar subscription code sends an OPTIONS request to the server to check its capabilities, yet incorrectly considers a 204 No Content response as invalid[1]. As the response to OPTIONS has no response body, 204 No Content is to be expected.

> CalDAV: Unexpected status 204 while querying options <calendar name here>

Cause seems to be line 1941 in providers/caldav/calDavCalendar.js. If that were to be set to `request.responseStatus >= 200 && request.responseStatus < 300`, I'm guessing it'd work fine.
My line assumption came from the commit https://hg.mozilla.org/comm-central/file/08bab4937197.
This patch takes care to accept also an 204 response on an OPTIONS request. Adding other 2xx flavours here doesn't seem to be appropriate here. Let's uplift this fix to 6.2 as well.
Assignee: nobody → makemyday
Status: UNCONFIRMED → ASSIGNED
Ever confirmed: true
Attachment #8964194 - Flags: review?(philipp)
Attachment #8964194 - Flags: approval-calendar-beta?(philipp)
Attachment #8964194 - Flags: review?(philipp)
Attachment #8964194 - Flags: review+
Attachment #8964194 - Flags: approval-calendar-beta?(philipp)
Attachment #8964194 - Flags: approval-calendar-beta+
Keywords: checkin-needed
Pushed by mozilla@jorgk.com:
https://hg.mozilla.org/comm-central/rev/7fc4d1316639
Accept 204 as valid server response on OPTIONS requests. r=philipp
Status: ASSIGNED → RESOLVED
Closed: 2 years ago
Keywords: checkin-needed
Resolution: --- → FIXED
Target Milestone: --- → 6.3
Beta (TB 60 beta 2, Calendar 6.2):
https://hg.mozilla.org/releases/comm-beta/rev/435135a9b280c3252ff84fb5565ff7b80167c325
Target Milestone: 6.3 → 6.2
You need to log in before you can comment on or make changes to this bug.