Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 505237
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T06:34:41+00:00 2026-05-13T06:34:41+00:00

I’m developing a front-end to a Rails application. In cross-browser testing, I immediately discovered

  • 0

I’m developing a front-end to a Rails application. In cross-browser testing, I immediately discovered that Internet Explorer (apparently all modern versions, but at least IE 7 and IE 8) is not correctly interpreting a file I’m trying to load via AJAX (with jQuery) as JavaScript. A file download warning appears and the user needs to confirm that the file should be downloaded. Unfortunately, this is not acceptable for the purposes of the application.

I created a couple of test files; one is just a JavaScript file served from Amazon S3; the other is actually a resource URL served by Varnish/Rails. The latter is the one that triggers the warning. So:


LINK: URL that gives a warning in IE

REQUEST HEADERS:

Accept:     application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5
User-Agent: Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10_6_2; en-us) AppleWebKit/531.21.8 (KHTML, like Gecko) Version/4.0.4 Safari/531.21.10

RESPONSE HEADERS:

Age:              1952
Cache-Control:    public, max-age=3598
Connection:       keep-alive
Content-Encoding: gzip
Content-Length:   2060
Content-Type:     text/javascript; charset=utf-8
Date:             Fri, 13 Nov 2009 22:54:18 GMT
Etag:             "272d9ec2e59aa92da18758cf42a4d729"
Server:           nginx/0.7.61 + Phusion Passenger 2.2.5 (mod_rails/mod_rack)
Status:           200 OK
Via:              1.1 varnish
X-Powered-By:     Phusion Passenger (mod_rails/mod_rack) 2.2.5
X-Runtime:        0.11573
X-Varnish:        176673116 176651738

LINK: URL that does not give a warning in IE

REQUEST HEADERS:

Accept:     application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5
User-Agent: Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10_6_2; en-us) AppleWebKit/531.21.8 (KHTML, like Gecko) Version/4.0.4 Safari/531.21.10

RESPONSE HEADERS:

Age:              14
Connection:       keep-alive
Content-Encoding: gzip
Content-Length:   52
Content-Type:     text/javascript
Date:             Fri, 13 Nov 2009 22:55:03 GMT
Etag:             "7b7ded6696ee52551289c856d3173db4"
Last-Modified:    Fri, 13 Nov 2009 22:30:45 GMT
Server:           AmazonS3
Via:              1.1 varnish
X-Amz-Id-2:       CR79uoLC67sr0e0uj4CUOCoBQgcIW/jaJc/FNSA3zsK3Lns/gAqx98/T9h/UeJGm
X-Amz-Request-Id: BCF2F2D69F5126DD
X-Varnish:        1566212056 1566211955

What immediately sticks out to me is the Content-Type of “text/javascript; charset=utf-8” for the URL that gives a warning – is that valid? I had always assumed that only “text/javascript” would be valid.

Also, the URL that gives a warning returns content of Content-Type “text/javascript,” but it is a Rails URL that does not have an extension of .js – could that make a difference?

Is there anything else that sticks out, or does anyone have any other ideas of what could be causing this problem? Thanks very much for any help.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-13T06:34:41+00:00Added an answer on May 13, 2026 at 6:34 am

    It’s been some time and I’ve since forgotten the details of this problem, but I do know that the ultimate cause was due to a POST request that returned a Content-Type of “text/javascript.”

    Apparently, IE interprets POSTs that return “text/javascript” in the response headers as a security threat, which causes it to display the dreadful, and terribly uninformative, error message bar.

    We changed the Content-Type of the response to “text/html” and that solved it!

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Ask A Question

Stats

  • Questions 309k
  • Answers 309k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer You could use a left join, Group By, and GROUP_CONCAT… May 13, 2026 at 9:53 pm
  • Editorial Team
    Editorial Team added an answer since you are selecting just one row (TOP 1) why… May 13, 2026 at 9:53 pm
  • Editorial Team
    Editorial Team added an answer Just add a style="display: none;" attr to the image html,… May 13, 2026 at 9:53 pm

Related Questions

I'm trying to decode HTML entries from here NYTimes.com and I cannot figure out
I want use html5's new tag to play a wav file (currently only supported
I ran into a problem. Wrote the following code snippet: teksti = teksti.Trim() teksti
I've got a string that has curly quotes in it. I'd like to replace
In order to apply a triggered animation to all ToolTip s in my app,

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.