Last modified: 2010-10-01 17:50:26 UTC

Wikimedia Bugzilla is closed!

Wikimedia migrated from Bugzilla to Phabricator. Bug reports are handled in Wikimedia Phabricator.
This static website is read-only and for historical purposes. It is not possible to log in and except for displaying bug reports and their history, links might be broken. See T27346, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 25346 - Geo lookup causes mime type errors in Chrome
Geo lookup causes mime type errors in Chrome
Status: RESOLVED FIXED
Product: MediaWiki extensions
Classification: Unclassified
CentralNotice (Other open bugs)
unspecified
All All
: Normal enhancement (vote)
: ---
Assigned To: Ryan Kaldari
http://meta.wikimedia.org
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2010-09-28 01:39 UTC by Tomasz Finc
Modified: 2010-10-01 17:50 UTC (History)
3 users (show)

See Also:
Web browser: ---
Mobile Platform: ---
Assignee Huggle Beta Tester: ---


Attachments

Description Tomasz Finc 2010-09-28 01:39:46 UTC
When loading http://meta.wikimedia.org with

Google Chrome 6.0.472.59
OS: OS X

I can see the following with the dev tools browser

Resource interpreted as script but transferred with MIME type application/json http://geoiplookup.wikimedia.org/?283u
Comment 1 Roan Kattouw 2010-09-28 13:01:53 UTC
CC Mark, who setup geoiplookup IIRC. The problem is that geoiplookup is returning a Content-Type: application/json header; this should be text/javascript .
Comment 2 Tomasz Finc 2010-09-28 16:58:52 UTC
What's interesting is the we changed it to application/json because that's what Safari was expecting.
Comment 3 Ryan Kaldari 2010-09-28 18:32:28 UTC
application/json is the correct MIME type for json (and indeed it seems that Chrome is the only browser complaining in this case). However, the geoIP JSON is not technically "well-formed" JSON, so this may be why Chrome is complaining. The geoIP JSON may not constitute "well-formed" Javascript either, so changing it to text/javascript may cause Safari to complain (as Safari seems to be sensitive to this). I guess what we need to do is test both MIME types in both browsers and see what we get.
Comment 4 Derk-Jan Hartman 2010-09-28 18:43:37 UTC
ticket collision:


It's not JSON though is it ? I mean it has "Geo =" that makes it JS, much like JSONP is just javascript.
application/json should only be used icw. XMLHTTPRequest objects I think.
Comment 5 Roan Kattouw 2010-09-29 15:21:22 UTC
(In reply to comment #4)
> ticket collision:
> 
> 
> It's not JSON though is it ? I mean it has "Geo =" that makes it JS, much like
> JSONP is just javascript.
> application/json should only be used icw. XMLHTTPRequest objects I think.
This is the right application, comment #2 and comment #3 are wrong.

text/javascript is the MIME type for executable JS. JSONP is really just executable JS that does something (call a function or set a variable) with inlined JSON data.

application/json is the MIME type for data encoded as JSON. By itself, this is valid JS, but executing it doesn't do much. This is used by XHR (i.e. normal same-domain AJAX) to grab JSON data that is then parsed (not executed!).
Comment 6 Ryan Kaldari 2010-10-01 17:50:26 UTC
fixed by Mark B.

Note You need to log in before you can comment on or make changes to this bug.


Navigation
Links