This is an automated email from the ASF dual-hosted git repository.

epugh pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/solr.git


The following commit(s) were added to refs/heads/main by this push:
     new 9491cc1  Remove documentation about bad practices for json responses 
and mime types. (#30)
9491cc1 is described below

commit 9491cc116e9cdd9c46a073f9c4b54df6a093193b
Author: Eric Pugh <[email protected]>
AuthorDate: Thu Mar 18 19:55:52 2021 -0400

    Remove documentation about bad practices for json responses and mime types. 
(#30)
---
 solr/CHANGES.txt                                               |  5 ++++-
 .../src/test-files/solr/collection1/conf/solrconfig.xml        |  8 --------
 .../solr/collection1/conf/solrconfig-implicitproperties.xml    |  7 -------
 .../configsets/sample_techproducts_configs/conf/solrconfig.xml | 10 ----------
 solr/solr-ref-guide/src/response-writers.adoc                  |  3 +++
 5 files changed, 7 insertions(+), 26 deletions(-)

diff --git a/solr/CHANGES.txt b/solr/CHANGES.txt
index 9f2ee9f..30759b9 100644
--- a/solr/CHANGES.txt
+++ b/solr/CHANGES.txt
@@ -94,6 +94,9 @@ when told to. The admin UI now tells it to. (Nazerke Seidan, 
David Smiley)
 * SOLR-2852: SolrJ: remove Woodstox dependency.  It was never truly required 
there.
   Software doing lots of XML processing can choose to add it or alternatives 
if they wish.
   (David Smiley)
+  
+* SOLR-15161: Don't encourage users to hack JSON response mimetype by 
documenting in examples how to
+  specify wt=json use mimetype of text/plain.  (Eric Pugh)
 
 Other Changes
 ----------------------
@@ -268,7 +271,7 @@ Improvements
 * SOLR-15191: Enhance hash method of JSON faceting to support EnumFieldType 
and perhaps some other/custom field types
   too. (Thomas Wöckinger, David Smiley)
 
-* SOLR-15194: Allow Solr to make outbound non SSL calls to a JWT IDP via 
-Dsolr.auth.jwt.allowOutboundHttp=true property. (Eric Pugh)  
+* SOLR-15194: Allow Solr to make outbound non SSL calls to a JWT IDP via 
-Dsolr.auth.jwt.allowOutboundHttp=true property. (Eric Pugh)
 
 * SOLR-15154: Let Http2SolrClient pass Basic Auth credentials to all requests 
(Tomás Fernández Löbbe)
 
diff --git 
a/solr/contrib/prometheus-exporter/src/test-files/solr/collection1/conf/solrconfig.xml
 
b/solr/contrib/prometheus-exporter/src/test-files/solr/collection1/conf/solrconfig.xml
index 31902a3..068635d 100644
--- 
a/solr/contrib/prometheus-exporter/src/test-files/solr/collection1/conf/solrconfig.xml
+++ 
b/solr/contrib/prometheus-exporter/src/test-files/solr/collection1/conf/solrconfig.xml
@@ -221,12 +221,4 @@
     <processor class="solr.RunUpdateProcessorFactory"/>
   </updateRequestProcessorChain>
 
-  <queryResponseWriter name="json" class="solr.JSONResponseWriter">
-    <!-- For the purposes of the tutorial, JSON responses are written as
-     plain text so that they are easy to read in *any* browser.
-     If you expect a MIME type of "application/json" just remove this override.
-    -->
-    <str name="content-type">text/plain; charset=UTF-8</str>
-  </queryResponseWriter>
-
 </config>
diff --git 
a/solr/core/src/test-files/solr/collection1/conf/solrconfig-implicitproperties.xml
 
b/solr/core/src/test-files/solr/collection1/conf/solrconfig-implicitproperties.xml
index 5ef9d72..3feef57 100644
--- 
a/solr/core/src/test-files/solr/collection1/conf/solrconfig-implicitproperties.xml
+++ 
b/solr/core/src/test-files/solr/collection1/conf/solrconfig-implicitproperties.xml
@@ -66,11 +66,4 @@
 
   </requestHandler>
 
-  <queryResponseWriter name="json" class="solr.JSONResponseWriter">
-    <!-- For the purposes of the tutorial, JSON responses are written as
-     plain text so that they are easy to read in *any* browser.
-     If you expect a MIME type of "application/json" just remove this override.
-    -->
-    <str name="content-type">text/plain; charset=UTF-8</str>
-  </queryResponseWriter>
 </config>
diff --git 
a/solr/server/solr/configsets/sample_techproducts_configs/conf/solrconfig.xml 
b/solr/server/solr/configsets/sample_techproducts_configs/conf/solrconfig.xml
index 50a8c2c..e2738e4 100644
--- 
a/solr/server/solr/configsets/sample_techproducts_configs/conf/solrconfig.xml
+++ 
b/solr/server/solr/configsets/sample_techproducts_configs/conf/solrconfig.xml
@@ -1331,16 +1331,6 @@
      <queryResponseWriter name="schema.xml" 
class="solr.SchemaXmlResponseWriter"/>
     -->
 
-  <!-- Overriding the content-type of the response writer.
-   -->
-  <queryResponseWriter name="json" class="solr.JSONResponseWriter">
-     <!-- For the purposes of the tutorial, JSON responses are written as
-      plain text so that they are easy to read in *any* browser.
-      If you expect a MIME type of "application/json" just remove this 
override.
-     -->
-    <str name="content-type">text/plain; charset=UTF-8</str>
-  </queryResponseWriter>
-
   <!-- XSLT response writer transforms the XML output by any xslt file found
        in Solr's conf/xslt directory.  Changes to xslt files are checked
        every xsltCacheLifetimeSeconds.  This is part of the Scripting contrib 
module.
diff --git a/solr/solr-ref-guide/src/response-writers.adoc 
b/solr/solr-ref-guide/src/response-writers.adoc
index 4c2323e..b132165 100644
--- a/solr/solr-ref-guide/src/response-writers.adoc
+++ b/solr/solr-ref-guide/src/response-writers.adoc
@@ -87,6 +87,9 @@ The default mime type for the JSON writer is 
`application/json`, however this ca
 </queryResponseWriter>
 ----
 
+WARNING: If you using the JSON formatted response with JSONP to query across 
boundaries, having Solr respond with `text/plain` mime type when the
+browser expects `application/json` will trigger the browser to block the 
request.
+
 === JSON-Specific Parameters
 
 ==== json.nl

Reply via email to