[Seaside] iCal to Drupal requires Content-Encoding: gzip

Boris Popov boris at deepcovelabs.com
Mon Sep 21 23:41:14 UTC 2009


By the way, it might be easier to compare text files obtained with curl,

curl -iL http://www.google.com > google.txt
curl -iL http://www.microsoft.com > microsoft.txt

-Boris

-- 
+1.604.689.0322
DeepCove Labs Ltd.
4th floor 595 Howe Street
Vancouver, Canada V6C 2T5
http://tinyurl.com/r7uw4


-----Original Message-----
From: seaside-bounces at lists.squeakfoundation.org [mailto:seaside-bounces at lists.squeakfoundation.org] On Behalf Of Boris Popov
Sent: Monday, September 21, 2009 1:51 PM
To: Seaside - general discussion
Subject: RE: [Seaside] iCal to Drupal requires Content-Encoding: gzip

Aren't you sending it as an attachment and google simply serving it in the contents? I see the following header in your response, but not in Google's? I agree with Philippe, it's very unlikely that gzipping is your problem.

Content-Disposition: attachment;filename=events.ics

-Boris

-- 
+1.604.689.0322
DeepCove Labs Ltd.
4th floor 595 Howe Street
Vancouver, Canada V6C 2T5
http://tinyurl.com/r7uw4


-----Original Message-----
From: seaside-bounces at lists.squeakfoundation.org [mailto:seaside-bounces at lists.squeakfoundation.org] On Behalf Of bobn at rogers.com
Sent: Monday, September 21, 2009 12:56 PM
To: Seaside List
Subject: [Seaside] iCal to Drupal requires Content-Encoding: gzip

Hello,
We're trying to provide an iCal feed from Seaside (on VW) to Drupal.  The Drupal use of the feed can be tested using a Google calendar iCal feed, and it works fine.  We're able to produce a simple iCal document as well, but Drupal does not accept it.  Both the Google and our Seaside iCal feeds download fine with just the browser.
The one big difference we can see in the header is that the Google contains 'Content-Encoding: gzip' and ours does not.  I have not be able to determine how we can properly provide the gzip compressed version of the content.  
Has anyone done an iCal feed from Seaside to Drupal?  Or, how can I get the gzip properly to be properly supported in my data source? 
Thanks for any help,
Bob Nemec
Cherniak Software
----
Here are some details... 
Documentation on iCal in Drupal ... 
http://drupal.org/node/341716 
http://www.drupalove.com/drupal-video/ical-events-nodes
I'm packaging the response with... (aFilename=events.ics, aContent is a read stream on the string)
  WAResponse new
   contentType: 'text/calendar;charset=utf-8';
   doNotCache;
   headerAt: 'Content-Disposition' put: 'attachment; filename="' , aFileName , '"';
   headerAt: 'Content-length' put: aContents size printString;
   contents: aContents;
   yourself
It looks like SeasideHttpWriteHandler>>prepareStream:forMessageBody: will do the compression with GZipWriteStream if useGZipTransfer = true, but I can't find a way to propagate that setting, and so far none of my attempts at hacking it are working.  I had hoped something as simple as adding #headerAt: 'Content-Encoding' put: 'gzip' would work, but that just creates an invalid file. 
To see the header contents, we use the Live HTTP headers Firefox plug in. 
This is the Google header... 
http://www.google.com/calendar/ical/<our test calendar ics file>
GET /calendar/ical/<our test calendar ics file> HTTP/1.1
Host: www.google.com
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.1.3) Gecko/20090824 Firefox/3.5.3 (.NET CLR 3.5.30729)
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
Accept-Language: en-us,en;q=0.5
Accept-Encoding: gzip,deflate
Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7
Keep-Alive: 300
Connection: keep-alive
Cookie: <some cookie data>
HTTP/1.x 200 OK
Content-Type: text/calendar; charset=UTF-8
Cache-Control: no-cache, no-store, max-age=0, must-revalidate
Pragma: no-cache
Expires: Fri, 01 Jan 1990 00:00:00 GMT
Date: Mon, 21 Sep 2009 00:14:03 GMT
Content-Encoding: gzip
X-Content-Type-Options: nosniff
X-Frame-Options: SAMEORIGIN
Content-Length: 3421
Server: GFE/2.0
----------------------------------------------------------
And this is our Seaside header... 
http://localhost:48199/seaside/Test
GET /seaside/Test HTTP/1.1
Host: localhost:48199
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.1.3) Gecko/20090824 Firefox/3.5.3 (.NET CLR 3.5.30729)
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
Accept-Language: en-us,en;q=0.5
Accept-Encoding: gzip,deflate
Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7
Keep-Alive: 300
Connection: keep-alive
Referer: http://localhost:48199/seaside
Cookie: <some cookie data>
HTTP/1.x 200 OK
Expires: Wed, 11 Jun 1980 08:00:00 -0400
Cache-Control: no-cache,must-revalidate
Pragma: no-cache
Content-Disposition: attachment;filename=events.ics
Content-Type: text/calendar;charset=utf-8
Content-Length: 10944
----------------------------------------------------------


WAKomCompressed>>convertResponse: aResponse 
        | response gzip stream | 
        response := super convertResponse: aResponse. 
        response fieldAt: 'Content-Encoding' put: 'gzip'. 
        gzip := GZipWriteStream on: (stream := RWBinaryOrTextStream on: ''). 
        gzip nextPutAll: aResponse contents contents; close. 
        ^ response contents: stream reset 

_______________________________________________
seaside mailing list
seaside at lists.squeakfoundation.org
http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
_______________________________________________
seaside mailing list
seaside at lists.squeakfoundation.org
http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside


More information about the seaside mailing list