The blog has moved to http://jessehouse.com/ ... Many google searches point here so I am leaving it operational, but there will be no new posts.

Wednesday, February 17, 2010

rails send_data fails on IE when SSL enabled

Came across a nasty issue using rails send_data with IE. Everything worked fine until the pages were running under SSL / HTTPS. Turns out the issue is with file download over SSL when the Cache-Control and Pragma html headers are set to no-cache.

The error message from IE
Internet Explorer was unable to open this site. The requested site is either unavailable or cannot be found. Please try again later.
The fix...
# before calling send_data
response.headers.delete("Pragma")
response.headers.delete('Cache-Control')
This issue is not restricted to rails, any server side code that sets no-cache is subject to the same issue. Glad I was able to find this post.

see also kb-316431

4 comments:

Anonymous said...

Thanks for posting this!!!!

This is issue is gone in IE9. I replicated issue in IE7 and IE8.

Thanks again

Unknown said...

Thanks Rafael, your post was really helpful, as we are giving IE-8 support to our Client's customers.

- Puneet

Unknown said...

Thanx for posting this. This is a big issue in IE-8

Praveen Kumar Sinha said...

It worked.. just what i needed.

Thanks
Praveen