Welcome to the MacNN Forums.

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

You are here: MacNN Forums > Software - Troubleshooting and Discussion > Applications > Garbled CSS on some sites (Safari and IE)

Garbled CSS on some sites (Safari and IE)
Thread Tools
eno
Banned
Join Date: Sep 2000
Location: Fightclub
Status: Offline
Reply With Quote
Jun 1, 2003, 10:56 PM
 
Weird problem:

A while back, a few sites started displaying strangely for me in Safari. Examples:

Ars forums

www.fileshack.com

It's so weird and I just can't troubleshoot it for the life of me.
  • The CSS that is downloaded contains only garbage characters
  • The problem only affects specific sites; all others are fine
  • It happens in IE as well, but not in OmniWeb, Camino, iCab, Opera, Mozilla etc
  • The two browsers that it affects (IE and Safari) have in common that they both request language-specific variants for a website (for example, when I go to apple.com I see the page in Spanish); the browsers that it does not effect do not ask for language-specific variants
  • The URL to the CSS is the same in all browsers, regardless of the language variant requested
  • Downloading the CSS directly by pasting it in the location bar of the browser results in a corrupted download in Safari and IE, but not in the other browsers
  • The problem affects all user accounts on my machine (no matter what the language preferences in the International preference pane)
  • Deleting cache files from ~/Library/Caches and ~/Library/Application Support/Safari has no effect
  • This whole phenomenon only started a few weeks ago; before that, it was fine... and I am not sure whether the problem coincided with any significant event, like the update to 10.2.6...

I am not aware of any other files on the drive that I could delete to try to eliminate this problem! A full system reinstall is all I can think of to fix it, and I am not about to do that.

Anyone else seen anything like this?
     
eno  (op)
Banned
Join Date: Sep 2000
Location: Fightclub
Status: Offline
Reply With Quote
Jun 1, 2003, 11:10 PM
 
More info... using Interarchy to capture packets I see that Safari is sending an HTTP request like this:

Code:
User-Agent: Mozilla/5.0 (Macintosh; U; PPC Mac OS X; es) AppleWebKit/74 (KHTML, like Gecko) Safari/74 Accept: */* Accept-Language: es, ja;q=0.43, en-gb;q=0.93, en;q=0.89, de-de;q=0.86, de;q=0.82, it-it;q=0.79, it;q=0.75, fr;q=0.71, nl-nl;q=0.68, nl;q=0.64, pt-pt;q=0.61, pt;q=0.57, sv-se;q=0.54, sv;q=0.50, ja-jp;q=0.46, en-au;q=0.96, no-no;q=0.39, no;q=0.36, da-dk;q=0.32, da;q=0.29, fi-fi;q=0.25, fi;q=0.21, zh-cn;q=0.18, zh-tw;q=0.14, zh;q=0.11, ko-kr;q=0.07, ko;q=0.04
And IE like this:

Code:
Accept: */* Accept-Language: en Connection: Keep-Alive If-Modified-Since: Sun, 01 Jun 2003 13:15:46 GMT User-Agent: Mozilla/4.0 (compatible; MSIE 5.22; Mac_PowerPC) UA-OS: MacOS UA-CPU: PPC Cookie: iToolsPlugin=installed Extension: Security/Remote-Passphrase
And Camino like this:

Code:
User-Agent: Mozilla/5.0 (Macintosh; U; PPC Mac OS X Mach-O; en-US; rv:1.0.1) Gecko/20030306 Camino/0.7 Accept: text/xml,application/xml,application/xhtml+xml,text/html ;q=0.9,text/plain;q=0.8,video/x-mng,image/png,image/jpeg,image/g if;q=0.2,text/css,*/*;q=0.1 Accept-Language: en-us, en;q=0.50 Accept-Encoding: gzip, deflate, compress;q=0.9 Keep-Alive: 300 Connection: keep-alive
So, in my original post I was wrong. IE is not requesting any language variants.... not sure why it's redirecting me to www.apple.com/es/....
     
eno  (op)
Banned
Join Date: Sep 2000
Location: Fightclub
Status: Offline
Reply With Quote
Jun 1, 2003, 11:20 PM
 
More info still:

- on a hunch, I passed the garbled CSS file (as downloaded by Safari) through StuffIt Expander... sure enough, it expanded into clear text (the ungarbled version of the CSS)...

Now.... this still leaves some unanswered questions:

Why do these same sites work fine in my friend's copy of Safari?

Why is the web server sending gzip-encoded style sheets even though Safari isn't requesting them?

Why isn't Safari handling the gzip compression (I thought this would be a feature already implemented, surely?)

Is it that Safari can handle gzip-encoding pages, but only for html pages and not items of type text/css?
     
eno  (op)
Banned
Join Date: Sep 2000
Location: Fightclub
Status: Offline
Reply With Quote
Jun 1, 2003, 11:41 PM
 
Ok, getting down to brass nails and tacks:

Request the CSS from fileshack.com (not www.fileshack.com) and it comes through fine:

The request:

Code:
GET /fileshack.css HTTP/1.1 Host: fileshack.com Connection: keep-alive User-Agent: Mozilla/5.0 (Macintosh; U; PPC Mac OS X; es) AppleWebKit/74 (KHTML, like Gecko) Safari/74 Accept: */* Accept-Language: es, ja;q=0.43, en-gb;q=0.93, en;q=0.89, de-de;q=0.86, de;q=0.82, it-it;q=0.79, it;q=0.75, fr;q=0.71, nl-nl;q=0.68, nl;q=0.64, pt-pt;q=0.61, pt;q=0.57, sv-se;q=0.54, sv;q=0.50, ja-jp;q=0.46, en-au;q=0.96, no-no;q=0.39, no;q=0.36, da-dk;q=0.32, da;q=0.29, fi-fi;q=0.25, fi;q=0.21, zh-cn;q=0.18, zh-tw;q=0.14, zh;q=0.11, ko-kr;q=0.07, ko;q=0.04
The reply:

Code:
HTTP/1.1 200 OK Date: Mon, 02 Jun 2003 03:21:39 GMT Server: Apache/1.3.26 (Unix) mod_fastcgi/2.2.12 mod_gzip/1.3.19. 1a PHP/4.1.2 mod_ssl/2.8.10 OpenSSL/0.9.6g Last-Modified: Mon, 05 May 2003 04:54:18 GMT ETag: "8007-2061-3eb5ee7a" Accept-Ranges: bytes Content-Length: 8289 Content-Type: text/css Connection: Keep-Alive
Now, request it from www.fileshack.com, and it comes through as garbage.

The request:

Code:
GET /fileshack.css HTTP/1.1 Host: www.fileshack.com Connection: keep-alive User-Agent: Mozilla/5.0 (Macintosh; U; PPC Mac OS X; es) AppleWebKit/74 (KHTML, like Gecko) Safari/74 Accept: */* Accept-Language: es, ja;q=0.43, en-gb;q=0.93, en;q=0.89, de-de;q=0.86, de;q=0.82, it-it;q=0.79, it;q=0.75, fr;q=0.71, nl-nl;q=0.68, nl;q=0.64, pt-pt;q=0.61, pt;q=0.57, sv-se;q=0.54, sv;q=0.50, ja-jp;q=0.46, en-au;q=0.96, no-no;q=0.39, no;q=0.36, da-dk;q=0.32, da;q=0.29, fi-fi;q=0.25, fi;q=0.21, zh-cn;q=0.18, zh-tw;q=0.14, zh;q=0.11, ko-kr;q=0.07, ko;q=0.04 Cookie: shackpw=blah; shacku=blah
The reply:

Code:
HTTP/1.1 200 OK Date: Mon, 02 Jun 2003 03:24:34 GMT Server: Apache/1.3.26 (Unix) mod_fastcgi/2.2.12 mod_gzip/1.3.19. 1a PHP/4.1.2 mod_ssl/2.8.10 OpenSSL/0.9.6g Last-Modified: Mon, 05 May 2003 04:54:18 GMT ETag: "8007-2061-3eb5ee7a" Accept-Ranges: bytes Content-Type: text/css Content-Encoding: gzip Content-Length: 1366 Connection: Close
Note that the only differences between the two cases are that in the latter (broken) case:

1. There is a cookie being sent with the request that contains my username and password.

2. The reply is coming back gzip-encoded

After deleting those cookies, quitting Safari, deleting all the cache files I could find in the Library, I tried again, and I continue to get gzip-encoded copies of the style sheet.

This is bizarre. No other sites manifest this problem, no other browsers. It's just these two sites with Safari and IE only.

Monitoring the traffic a bit more, it seems that the following is true:

1. Safari *cannot* handle gzip-encoded content
2. Most sites don't send gzip-encoded content unless asked for it; but for some reason these two sites are sending it, and only for the CSS files, and only for *my* copy of Safari, even though there is clearly no request for gzip-encoded content in my HTTP requests...

I still suspect some cache-related issue, given that I see the problem for:

www.fileshack.com/fileshack.css (which has been visited before, and manifests the problem)

but not for:

fileshack.com/fileshack.css (which has NOT been visited before, and does not manifest the problem)

But the question remains, where is the cache? It affects all users on the machine....
     
krove
Mac Elite
Join Date: Jul 2000
Location: Washington, DC
Status: Offline
Reply With Quote
Jun 2, 2003, 12:52 AM
 
I'm most certain that you have already done so, but make sure you've submitted the bug to Apple.

How did it come to this? Goodbye PowerPC. | sensory output
     
eno  (op)
Banned
Join Date: Sep 2000
Location: Fightclub
Status: Offline
Reply With Quote
Jun 2, 2003, 06:09 AM
 
Originally posted by krove:
I'm most certain that you have already done so, but make sure you've submitted the bug to Apple.
Well, actually, I hadn't.... mostly because I am not sure that it IS a bug... If anybody else reported the same problem then I would start to think so, but as it stands, I am not aware of anyone else having this problem and I am totally perplexed by it.

     
headbirth
Mac Elite
Join Date: May 2002
Status: Offline
Reply With Quote
Jun 2, 2003, 06:57 AM
 
Not sure if it was the same problem, but I was getting odd numeric values instead of text occassionally in Safari. When it started to pop-up in my system font menus I realized it was a corrupt font that was causing my Safari problems.
     
   
 
Forum Links
Forum Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Top
Privacy Policy
All times are GMT -4. The time now is 04:23 PM.
All contents of these forums © 1995-2017 MacNN. All rights reserved.
Branding + Design: www.gesamtbild.com
vBulletin v.3.8.8 © 2000-2017, Jelsoft Enterprises Ltd.,