You are viewing a plain text version of this content. The canonical link for it is here.
Posted to solr-user@lucene.apache.org by Emmanuel Bégué <me...@gmail.com> on 2010/12/21 00:24:15 UTC

Mime type for JSON

Hello,

When using a writer type of "json", SOLR (1.4.1) sets the content type
header of the response as "text/plain" although it should be
"application/json". This is not a very big problem, but it writes many
warnings in Chrome logs: "Resource interpreted as script but
transferred with MIME type text/plain."

This is documented here:
https://issues.apache.org/jira/browse/SOLR-1123

but it's unclear whether it will be addressed (or, indeed, should be addressed).

Is there another way to force the mime-type? I use Tomcat -> jk
connector -> Apache, and I tried to force the mime-type as a
mod_rewrite directive ([T=application/json]). The Apache rewrite log
says the mime type is changed:

   force filename redirect:/solr-app/search to have MIME-type 'application/json'

but it is, in fact, not (probably because the mime type sent by
Tomcat/SOLR go through...?)

Any ideas?

Thanks,
Regards,
EB