I have a javascript file (and have seen this with other static content) that is sometimes not being delivered correctly by tomcat, despite a 200 response. I have tried server versions 6.0.18 and 6.0.33 with the same result. Below is an example of the result I see using wget to request the same item several times, feel free to try yourself if that helps:
--20:00:46-- http://t-pen.org/TPEN/transcription.js => `transcription.js.28' Resolving t-pen.org... 165.134.241.71 Connecting to t-pen.org|165.134.241.71|:80... connected. HTTP request sent, awaiting response... 200 OK Length: unspecified
(See no mime type)
--20:01:06-- http://t-pen.org/TPEN/transcription.js => `transcription.js.29' Resolving t-pen.org... 165.134.241.71 Connecting to t-pen.org|165.134.241.71|:80... connected. HTTP request sent, awaiting response... 200 OK Length: 97,373 (95K) [text/javascript]
The problem in the browser is a message stating that the mime type for the javascript is incorrect. I havent messed with the mime type configuration in tomcat, and it comes through correctly most times, so I really dont know where I can look to try to solve this. Any help is much appreciated.
curl
output for problematic GET:
$ curl -v http://t-pen.org/TPEN/transcription.js > /dev/null
> GET /TPEN/transcription.js HTTP/1.1
> User-Agent: curl/7.21.6 (i686-pc-linux-gnu) libcurl/7.21.6 OpenSSL/1.0.0e zlib/1.2.3.4 libidn/1.22 librtmp/2.3
> Host: t-pen.org
> Accept: */*
>
< HTTP/1.1 200 OK
< Server: Apache-Coyote/1.1
< Transfer-Encoding: chunked
< Date: Thu, 27 Oct 2011 20:43:55 GMT
<
{ [data not shown]
100 97373 0 97373 0 0 86338 0 --:--:-- 0:00:01 --:--:-- 112k
and normal one:
$ curl -v http://t-pen.org/TPEN/transcription.js > /dev/null
> GET /TPEN/transcription.js HTTP/1.1
> User-Agent: curl/7.21.6 (i686-pc-linux-gnu) libcurl/7.21.6 OpenSSL/1.0.0e zlib/1.2.3.4 libidn/1.22 librtmp/2.3
> Host: t-pen.org
> Accept: */*
>
< HTTP/1.1 200 OK
< Server: Apache-Coyote/1.1
< ETag: W/"97373-1319761050000"
< Last-Modified: Fri, 28 Oct 2011 00:17:30 GMT
< Content-Type: text/javascript
< Content-Length: 97373
< Date: Thu, 27 Oct 2011 20:45:21 GMT
<
{ [data not shown]
100 97373 100 97373 0 0 86196 0 0:00:01 0:00:01 --:--:-- 112k
curl
and find out that few other headers are not sent for bogus GETs. Since this is not an answer but it also didn't fit in comment I let myself modify your question, hope you don't mind and it will help. – Tomasz Nurkiewicz Oct 27 '11 at 20:50