GNOME Bugzilla – Bug 760832
Cannot access Yahoo! calendar
Last modified: 2016-01-25 12:31:36 UTC
Created attachment 319342 [details] test-soup.c Trying to access Yahoo! calendar using libsoup results in Message Corrupt response and nothing is working. This is not a case with curl, where the below command succeeds: curl --verbose -X OPTIONS https://user%40ymail.com@caldav.calendar.yahoo.com/dav/user%40ymail.com/Calendar/User/ Even this command copy&pasted into the terminal works correctly, the result is a response with headers: < DAV: 1, 3, calendar-access < MS-Author-Via: DAV < Allow: MKCOL, REPORT, MOVE, COPY, HEAD, POST, GET, DELETE, MKCALENDAR, ACL, PROPFIND, OPTIONS, PROPPATCH, PUT The attached test-soup.c contains a command line to build and run it as its first line comment. Just do that and you'll see a response: < HTTP/1.1 8 Message Corrupt < Soup-Debug-Timestamp: 1453210571 < Soup-Debug: SoupMessage 1 (0x62100000a8a0) test_thread: Failed, certflags:0 code:8 reason:Message Corrupt
Created attachment 319352 [details] [review] proposed patch for libsoup; This patch makes libsoup forgiving for the Yahoo! server. It's Yahoo!'s fault, providing headers in this way: HTTP/1.1 401 Unauthorized Date: Tue, 19 Jan 2016 13:02:57 GMT Connection: close Via: http/1.1 calgate123.cal.bf2.yahoo.com (ApacheTrafficServer) Server: ATS Www-Authenticate: Basic realm="YahooCalendar"\0 Www-Authenticate: OAuth realm="YahooCalendar"\0 Content-Length: 0 Notice the \0 after the first Www-Authenticate header, it's in bytes: ...\0\r\nWww-... similarly with the second \0, which is in bytes: ..."\0\r\nCont... I know it's a fault on the Yahoo! server, but libsoup could be forgiving for such errors in the headers, similar as curl is. The attached is a patch which makes libsoup work with the Yahoo! server. I do not know how to properly report this issue to Yahoo! people, but I will try at least somehow to do it and report back here in case I'd have anything from them.
Created attachment 319595 [details] [review] soup_headers_parse: deal with NUL bytes in headers -------- The proposed patch seems to truncate the headers at the '\0', which seems wrong. This patch just strips out any '\0's. Does it work for you?
Thanks, it works just fine. Even better than that mine initial (mine hid OAuth authentication type, while yours keep it there). I wasn't sure whether it's possible to simply "skip" those \0 in the headers, thus I decided to stop on the first one instead. It's a server fault, after all.
> I wasn't sure whether it's possible to simply "skip" those \0 in the headers, > thus I decided to stop on the first one instead. It's a server fault, after > all. I figure, the server sent the other headers, so clearly it wants us to look at them... Attachment 319595 [details] pushed as dcf45cb - soup_headers_parse: deal with NUL bytes in headers