Bug 632497 - Use a content-type hint for asyncFetch in AutoCompleteCache [r=mfinkle]
--- a/mobile/components/AutoCompleteCache.js
+++ b/mobile/components/AutoCompleteCache.js
@@ -196,17 +196,19 @@ var AutoCompleteUtils = {
},
loadCache: function loadCache() {
if (!this.cacheFile.exists())
return;
try {
let self = this;
- NetUtil.asyncFetch(this.cacheFile, function(aInputStream, aResultCode) {
+ let channel = NetUtil.newChannel(this.cacheFile);
+ channel.setContentType("application/json");
+ NetUtil.asyncFetch(channel, function(aInputStream, aResultCode) {
if (Components.isSuccessCode(aResultCode)) {
let cache = Cc["@mozilla.org/dom/json;1"].createInstance(Ci.nsIJSON).
decodeFromStream(aInputStream, aInputStream.available());
if (cache.version != CACHE_VERSION) {
self.fetch(self.query);
return;
}