[jira] [Commented] (SOLR-11266) V2 API returning wrong content-type
[ https://issues.apache.org/jira/browse/SOLR-11266?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16895770#comment-16895770 ] ASF subversion and git services commented on SOLR-11266: Commit cb94eeb4919ff6484f186f534377d9ad9b24c33c in lucene-solr's branch refs/heads/master from Munendra S N [ https://gitbox.apache.org/repos/asf?p=lucene-solr.git;h=cb94eeb ] SOLR-11266: remove content-type override from _default configSet > V2 API returning wrong content-type > --- > > Key: SOLR-11266 > URL: https://issues.apache.org/jira/browse/SOLR-11266 > Project: Solr > Issue Type: Improvement > Components: v2 API >Reporter: Ishan Chattopadhyaya >Priority: Major > Attachments: SOLR-11266.patch, SOLR-11266.patch > > > The content-type of the returned value is wrong in many places. It should > return "application/json", but instead returns "application/text-plan". > Here's an example: > {code} > [ishan@t430 ~] $ curl -v > "http://localhost:8983/api/collections/products/select?q=*:*=0; > * Trying 127.0.0.1... > * TCP_NODELAY set > * Connected to localhost (127.0.0.1) port 8983 (#0) > > GET /api/collections/products/select?q=*:*=0 HTTP/1.1 > > Host: localhost:8983 > > User-Agent: curl/7.51.0 > > Accept: */* > > > < HTTP/1.1 200 OK > < Content-Type: text/plain;charset=utf-8 > < Content-Length: 184 > < > { > "responseHeader":{ > "zkConnected":true, > "status":0, > "QTime":1, > "params":{ > "q":"*:*", > "rows":"0"}}, > "response":{"numFound":260,"start":0,"docs":[] > }} > * Curl_http_done: called premature == 0 > * Connection #0 to host localhost left intact > {code} -- This message was sent by Atlassian JIRA (v7.6.14#76016) - To unsubscribe, e-mail: dev-unsubscr...@lucene.apache.org For additional commands, e-mail: dev-h...@lucene.apache.org
[jira] [Commented] (SOLR-11266) V2 API returning wrong content-type
[ https://issues.apache.org/jira/browse/SOLR-11266?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16891174#comment-16891174 ] Munendra S N commented on SOLR-11266: - Planning to commit in a day or two. [~gus_heck], could you please review this once? > V2 API returning wrong content-type > --- > > Key: SOLR-11266 > URL: https://issues.apache.org/jira/browse/SOLR-11266 > Project: Solr > Issue Type: Improvement > Components: v2 API >Reporter: Ishan Chattopadhyaya >Priority: Major > Attachments: SOLR-11266.patch, SOLR-11266.patch > > > The content-type of the returned value is wrong in many places. It should > return "application/json", but instead returns "application/text-plan". > Here's an example: > {code} > [ishan@t430 ~] $ curl -v > "http://localhost:8983/api/collections/products/select?q=*:*=0; > * Trying 127.0.0.1... > * TCP_NODELAY set > * Connected to localhost (127.0.0.1) port 8983 (#0) > > GET /api/collections/products/select?q=*:*=0 HTTP/1.1 > > Host: localhost:8983 > > User-Agent: curl/7.51.0 > > Accept: */* > > > < HTTP/1.1 200 OK > < Content-Type: text/plain;charset=utf-8 > < Content-Length: 184 > < > { > "responseHeader":{ > "zkConnected":true, > "status":0, > "QTime":1, > "params":{ > "q":"*:*", > "rows":"0"}}, > "response":{"numFound":260,"start":0,"docs":[] > }} > * Curl_http_done: called premature == 0 > * Connection #0 to host localhost left intact > {code} -- This message was sent by Atlassian JIRA (v7.6.14#76016) - To unsubscribe, e-mail: dev-unsubscr...@lucene.apache.org For additional commands, e-mail: dev-h...@lucene.apache.org
[jira] [Commented] (SOLR-11266) V2 API returning wrong content-type
[ https://issues.apache.org/jira/browse/SOLR-11266?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16889566#comment-16889566 ] Lucene/Solr QA commented on SOLR-11266: --- | (x) *{color:red}-1 overall{color}* | \\ \\ || Vote || Subsystem || Runtime || Comment || || || || || {color:brown} Prechecks {color} || | {color:red}-1{color} | {color:red} test4tests {color} | {color:red} 0m 0s{color} | {color:red} The patch doesn't appear to include any new or modified tests. Please justify why no new tests are needed for this patch. Also please list what manual steps were performed to verify this patch. {color} | || || || || {color:brown} master Compile Tests {color} || | {color:green}+1{color} | {color:green} compile {color} | {color:green} 1m 57s{color} | {color:green} master passed {color} | || || || || {color:brown} Patch Compile Tests {color} || | {color:green}+1{color} | {color:green} compile {color} | {color:green} 1m 57s{color} | {color:green} the patch passed {color} | | {color:green}+1{color} | {color:green} javac {color} | {color:green} 1m 57s{color} | {color:green} the patch passed {color} | | {color:green}+1{color} | {color:green} Check configsets' lucene version {color} | {color:green} 1m 57s{color} | {color:green} the patch passed {color} | | {color:green}+1{color} | {color:green} Release audit (RAT) {color} | {color:green} 1m 57s{color} | {color:green} the patch passed {color} | | {color:green}+1{color} | {color:green} Validate source patterns {color} | {color:green} 1m 57s{color} | {color:green} the patch passed {color} | || || || || {color:brown} Other Tests {color} || | {color:green}+1{color} | {color:green} unit {color} | {color:green} 33m 32s{color} | {color:green} core in the patch passed. {color} | | {color:black}{color} | {color:black} {color} | {color:black} 38m 14s{color} | {color:black} {color} | \\ \\ || Subsystem || Report/Notes || | JIRA Issue | SOLR-11266 | | JIRA Patch URL | https://issues.apache.org/jira/secure/attachment/12975313/SOLR-11266.patch | | Optional Tests | compile javac unit ratsources validatesourcepatterns checkluceneversion | | uname | Linux lucene1-us-west 4.15.0-54-generic #58-Ubuntu SMP Mon Jun 24 10:55:24 UTC 2019 x86_64 x86_64 x86_64 GNU/Linux | | Build tool | ant | | Personality | /home/jenkins/jenkins-slave/workspace/PreCommit-SOLR-Build/sourcedir/dev-tools/test-patch/lucene-solr-yetus-personality.sh | | git revision | master / ebeae0c889 | | ant | version: Apache Ant(TM) version 1.10.5 compiled on March 28 2019 | | Default Java | LTS | | Test Results | https://builds.apache.org/job/PreCommit-SOLR-Build/505/testReport/ | | modules | C: solr/core solr/server U: solr | | Console output | https://builds.apache.org/job/PreCommit-SOLR-Build/505/console | | Powered by | Apache Yetus 0.7.0 http://yetus.apache.org | This message was automatically generated. > V2 API returning wrong content-type > --- > > Key: SOLR-11266 > URL: https://issues.apache.org/jira/browse/SOLR-11266 > Project: Solr > Issue Type: Improvement > Components: v2 API >Reporter: Ishan Chattopadhyaya >Priority: Major > Attachments: SOLR-11266.patch, SOLR-11266.patch > > > The content-type of the returned value is wrong in many places. It should > return "application/json", but instead returns "application/text-plan". > Here's an example: > {code} > [ishan@t430 ~] $ curl -v > "http://localhost:8983/api/collections/products/select?q=*:*=0; > * Trying 127.0.0.1... > * TCP_NODELAY set > * Connected to localhost (127.0.0.1) port 8983 (#0) > > GET /api/collections/products/select?q=*:*=0 HTTP/1.1 > > Host: localhost:8983 > > User-Agent: curl/7.51.0 > > Accept: */* > > > < HTTP/1.1 200 OK > < Content-Type: text/plain;charset=utf-8 > < Content-Length: 184 > < > { > "responseHeader":{ > "zkConnected":true, > "status":0, > "QTime":1, > "params":{ > "q":"*:*", > "rows":"0"}}, > "response":{"numFound":260,"start":0,"docs":[] > }} > * Curl_http_done: called premature == 0 > * Connection #0 to host localhost left intact > {code} -- This message was sent by Atlassian JIRA (v7.6.14#76016) - To unsubscribe, e-mail: dev-unsubscr...@lucene.apache.org For additional commands, e-mail: dev-h...@lucene.apache.org
[jira] [Commented] (SOLR-11266) V2 API returning wrong content-type
[ https://issues.apache.org/jira/browse/SOLR-11266?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16889497#comment-16889497 ] Munendra S N commented on SOLR-11266: - [^SOLR-11266.patch] Doesn't look like test failure is due to this change. I haven't been able to reproduce it locally. I have attached same patch to retrigger the patch validation > V2 API returning wrong content-type > --- > > Key: SOLR-11266 > URL: https://issues.apache.org/jira/browse/SOLR-11266 > Project: Solr > Issue Type: Improvement > Components: v2 API >Reporter: Ishan Chattopadhyaya >Priority: Major > Attachments: SOLR-11266.patch, SOLR-11266.patch > > > The content-type of the returned value is wrong in many places. It should > return "application/json", but instead returns "application/text-plan". > Here's an example: > {code} > [ishan@t430 ~] $ curl -v > "http://localhost:8983/api/collections/products/select?q=*:*=0; > * Trying 127.0.0.1... > * TCP_NODELAY set > * Connected to localhost (127.0.0.1) port 8983 (#0) > > GET /api/collections/products/select?q=*:*=0 HTTP/1.1 > > Host: localhost:8983 > > User-Agent: curl/7.51.0 > > Accept: */* > > > < HTTP/1.1 200 OK > < Content-Type: text/plain;charset=utf-8 > < Content-Length: 184 > < > { > "responseHeader":{ > "zkConnected":true, > "status":0, > "QTime":1, > "params":{ > "q":"*:*", > "rows":"0"}}, > "response":{"numFound":260,"start":0,"docs":[] > }} > * Curl_http_done: called premature == 0 > * Connection #0 to host localhost left intact > {code} -- This message was sent by Atlassian JIRA (v7.6.14#76016) - To unsubscribe, e-mail: dev-unsubscr...@lucene.apache.org For additional commands, e-mail: dev-h...@lucene.apache.org
[jira] [Commented] (SOLR-11266) V2 API returning wrong content-type
[ https://issues.apache.org/jira/browse/SOLR-11266?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16889471#comment-16889471 ] Lucene/Solr QA commented on SOLR-11266: --- | (x) *{color:red}-1 overall{color}* | \\ \\ || Vote || Subsystem || Runtime || Comment || || || || || {color:brown} Prechecks {color} || | {color:red}-1{color} | {color:red} test4tests {color} | {color:red} 0m 0s{color} | {color:red} The patch doesn't appear to include any new or modified tests. Please justify why no new tests are needed for this patch. Also please list what manual steps were performed to verify this patch. {color} | || || || || {color:brown} master Compile Tests {color} || | {color:green}+1{color} | {color:green} compile {color} | {color:green} 2m 7s{color} | {color:green} master passed {color} | || || || || {color:brown} Patch Compile Tests {color} || | {color:green}+1{color} | {color:green} compile {color} | {color:green} 1m 56s{color} | {color:green} the patch passed {color} | | {color:green}+1{color} | {color:green} javac {color} | {color:green} 1m 56s{color} | {color:green} the patch passed {color} | | {color:green}+1{color} | {color:green} Check configsets' lucene version {color} | {color:green} 1m 56s{color} | {color:green} the patch passed {color} | | {color:green}+1{color} | {color:green} Release audit (RAT) {color} | {color:green} 1m 56s{color} | {color:green} the patch passed {color} | | {color:green}+1{color} | {color:green} Validate source patterns {color} | {color:green} 1m 56s{color} | {color:green} the patch passed {color} | || || || || {color:brown} Other Tests {color} || | {color:red}-1{color} | {color:red} unit {color} | {color:red} 35m 4s{color} | {color:red} core in the patch failed. {color} | | {color:black}{color} | {color:black} {color} | {color:black} 40m 4s{color} | {color:black} {color} | \\ \\ || Reason || Tests || | Failed junit tests | solr.cloud.CollectionsAPISolrJTest | \\ \\ || Subsystem || Report/Notes || | JIRA Issue | SOLR-11266 | | JIRA Patch URL | https://issues.apache.org/jira/secure/attachment/12975273/SOLR-11266.patch | | Optional Tests | compile javac unit ratsources validatesourcepatterns checkluceneversion | | uname | Linux lucene1-us-west 4.15.0-54-generic #58-Ubuntu SMP Mon Jun 24 10:55:24 UTC 2019 x86_64 x86_64 x86_64 GNU/Linux | | Build tool | ant | | Personality | /home/jenkins/jenkins-slave/workspace/PreCommit-SOLR-Build/sourcedir/dev-tools/test-patch/lucene-solr-yetus-personality.sh | | git revision | master / b5a190b576 | | ant | version: Apache Ant(TM) version 1.10.5 compiled on March 28 2019 | | Default Java | LTS | | unit | https://builds.apache.org/job/PreCommit-SOLR-Build/502/artifact/out/patch-unit-solr_core.txt | | Test Results | https://builds.apache.org/job/PreCommit-SOLR-Build/502/testReport/ | | modules | C: solr/core solr/server U: solr | | Console output | https://builds.apache.org/job/PreCommit-SOLR-Build/502/console | | Powered by | Apache Yetus 0.7.0 http://yetus.apache.org | This message was automatically generated. > V2 API returning wrong content-type > --- > > Key: SOLR-11266 > URL: https://issues.apache.org/jira/browse/SOLR-11266 > Project: Solr > Issue Type: Improvement > Components: v2 API >Reporter: Ishan Chattopadhyaya >Priority: Major > Attachments: SOLR-11266.patch > > > The content-type of the returned value is wrong in many places. It should > return "application/json", but instead returns "application/text-plan". > Here's an example: > {code} > [ishan@t430 ~] $ curl -v > "http://localhost:8983/api/collections/products/select?q=*:*=0; > * Trying 127.0.0.1... > * TCP_NODELAY set > * Connected to localhost (127.0.0.1) port 8983 (#0) > > GET /api/collections/products/select?q=*:*=0 HTTP/1.1 > > Host: localhost:8983 > > User-Agent: curl/7.51.0 > > Accept: */* > > > < HTTP/1.1 200 OK > < Content-Type: text/plain;charset=utf-8 > < Content-Length: 184 > < > { > "responseHeader":{ > "zkConnected":true, > "status":0, > "QTime":1, > "params":{ > "q":"*:*", > "rows":"0"}}, > "response":{"numFound":260,"start":0,"docs":[] > }} > * Curl_http_done: called premature == 0 > * Connection #0 to host localhost left intact > {code} -- This message was sent by Atlassian JIRA (v7.6.14#76016) - To unsubscribe, e-mail: dev-unsubscr...@lucene.apache.org For additional commands, e-mail: dev-h...@lucene.apache.org
[jira] [Commented] (SOLR-11266) V2 API returning wrong content-type
[ https://issues.apache.org/jira/browse/SOLR-11266?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16889170#comment-16889170 ] Gus Heck commented on SOLR-11266: - I do agree that it's not a bug by the way :) > V2 API returning wrong content-type > --- > > Key: SOLR-11266 > URL: https://issues.apache.org/jira/browse/SOLR-11266 > Project: Solr > Issue Type: Improvement > Components: v2 API >Reporter: Ishan Chattopadhyaya >Priority: Major > Attachments: SOLR-11266.patch > > > The content-type of the returned value is wrong in many places. It should > return "application/json", but instead returns "application/text-plan". > Here's an example: > {code} > [ishan@t430 ~] $ curl -v > "http://localhost:8983/api/collections/products/select?q=*:*=0; > * Trying 127.0.0.1... > * TCP_NODELAY set > * Connected to localhost (127.0.0.1) port 8983 (#0) > > GET /api/collections/products/select?q=*:*=0 HTTP/1.1 > > Host: localhost:8983 > > User-Agent: curl/7.51.0 > > Accept: */* > > > < HTTP/1.1 200 OK > < Content-Type: text/plain;charset=utf-8 > < Content-Length: 184 > < > { > "responseHeader":{ > "zkConnected":true, > "status":0, > "QTime":1, > "params":{ > "q":"*:*", > "rows":"0"}}, > "response":{"numFound":260,"start":0,"docs":[] > }} > * Curl_http_done: called premature == 0 > * Connection #0 to host localhost left intact > {code} -- This message was sent by Atlassian JIRA (v7.6.14#76016) - To unsubscribe, e-mail: dev-unsubscr...@lucene.apache.org For additional commands, e-mail: dev-h...@lucene.apache.org
[jira] [Commented] (SOLR-11266) V2 API returning wrong content-type
[ https://issues.apache.org/jira/browse/SOLR-11266?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16889155#comment-16889155 ] Yonik Seeley commented on SOLR-11266: - > One can't say that we are serving valid JSON Perhaps not a valid HTTP JSON response, but a valid text response containing valid JSON. It was deliberate and still standards conforming, and no longer needed. For more context, some of our previous tutorials embedded hyperlinks that users were supposed to click on and see results in their browsers (which resulted in a very poor experience when a browser couldn't handle the content-type by default) > V2 API returning wrong content-type > --- > > Key: SOLR-11266 > URL: https://issues.apache.org/jira/browse/SOLR-11266 > Project: Solr > Issue Type: Bug > Components: v2 API >Reporter: Ishan Chattopadhyaya >Priority: Major > Attachments: SOLR-11266.patch > > > The content-type of the returned value is wrong in many places. It should > return "application/json", but instead returns "application/text-plan". > Here's an example: > {code} > [ishan@t430 ~] $ curl -v > "http://localhost:8983/api/collections/products/select?q=*:*=0; > * Trying 127.0.0.1... > * TCP_NODELAY set > * Connected to localhost (127.0.0.1) port 8983 (#0) > > GET /api/collections/products/select?q=*:*=0 HTTP/1.1 > > Host: localhost:8983 > > User-Agent: curl/7.51.0 > > Accept: */* > > > < HTTP/1.1 200 OK > < Content-Type: text/plain;charset=utf-8 > < Content-Length: 184 > < > { > "responseHeader":{ > "zkConnected":true, > "status":0, > "QTime":1, > "params":{ > "q":"*:*", > "rows":"0"}}, > "response":{"numFound":260,"start":0,"docs":[] > }} > * Curl_http_done: called premature == 0 > * Connection #0 to host localhost left intact > {code} -- This message was sent by Atlassian JIRA (v7.6.14#76016) - To unsubscribe, e-mail: dev-unsubscr...@lucene.apache.org For additional commands, e-mail: dev-h...@lucene.apache.org
[jira] [Commented] (SOLR-11266) V2 API returning wrong content-type
[ https://issues.apache.org/jira/browse/SOLR-11266?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16889152#comment-16889152 ] Gus Heck commented on SOLR-11266: - {quote}More than someone trying to write a context-free Solr client I'd say ;) {quote} You mean like jquery? with it's default intelligent guess setting? {panel:title= dataType (default: Intelligent Guess (xml, json, script, or html))} Type: [String|http://api.jquery.com/Types/#String] The type of data that you're expecting back from the server. If none is specified, jQuery will try to infer it based on the MIME type of the response (an XML MIME type will yield XML, in 1.4 JSON will yield a JavaScript object, in 1.4 script will execute the script, and anything else will be returned as a string). {panel} Seen here in dev console on current solr home page with a collection named foo: {code:java} $.ajax("/solr/foo/query?q=*:*").done(function(data) {console.log(typeof data)}); string {code} Sure you can specify the dataType as json (i.e. hardcode the expected type, the most common solution)... but by default you get a string, and so first contact with solr for most jquery ui programmers is to hit an error and discover that the jquery defaults don't work... {quote}(but it's not incorrect to have json formatted text in a plain text HTTP response, and I disagree that this issue should be categorized as a bug.) Although one can argue that application/json is *more* appropriate given that it's more specific. {quote} absolutely true from the HTTP spec perspective, anything that can handle text/plain will not break when receiving application/json, but not true from a JSON perspective where RFC 4627 and 7159 do state that the correct media type is application/json. So one can say correctly that we serve valid text/plain. One can't say that we are serving valid JSON, because we haven't served it with the correct media type. It is true that the error we are making is so common (see also: text/json text/x-json, etc) that there are easy workarounds built into many libraries. > V2 API returning wrong content-type > --- > > Key: SOLR-11266 > URL: https://issues.apache.org/jira/browse/SOLR-11266 > Project: Solr > Issue Type: Bug > Components: v2 API >Reporter: Ishan Chattopadhyaya >Priority: Major > Attachments: SOLR-11266.patch > > > The content-type of the returned value is wrong in many places. It should > return "application/json", but instead returns "application/text-plan". > Here's an example: > {code} > [ishan@t430 ~] $ curl -v > "http://localhost:8983/api/collections/products/select?q=*:*=0; > * Trying 127.0.0.1... > * TCP_NODELAY set > * Connected to localhost (127.0.0.1) port 8983 (#0) > > GET /api/collections/products/select?q=*:*=0 HTTP/1.1 > > Host: localhost:8983 > > User-Agent: curl/7.51.0 > > Accept: */* > > > < HTTP/1.1 200 OK > < Content-Type: text/plain;charset=utf-8 > < Content-Length: 184 > < > { > "responseHeader":{ > "zkConnected":true, > "status":0, > "QTime":1, > "params":{ > "q":"*:*", > "rows":"0"}}, > "response":{"numFound":260,"start":0,"docs":[] > }} > * Curl_http_done: called premature == 0 > * Connection #0 to host localhost left intact > {code} -- This message was sent by Atlassian JIRA (v7.6.14#76016) - To unsubscribe, e-mail: dev-unsubscr...@lucene.apache.org For additional commands, e-mail: dev-h...@lucene.apache.org
[jira] [Commented] (SOLR-11266) V2 API returning wrong content-type
[ https://issues.apache.org/jira/browse/SOLR-11266?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16889096#comment-16889096 ] Yonik Seeley commented on SOLR-11266: - > I'm not of the opinion that users looking at a response in a browser are our > main target audience. More than someone trying to write a context-free Solr client I'd say ;) I think most people wanted application/json out of a misguided sense of correctness (but it's not incorrect to have json formatted text in a plain text HTTP response, and I disagree that this issue should be categorized as a bug.) Although one can argue that application/json is *more* appropriate given that it's more specific. That said, I just tried out the current versions of chrome, safari, and firefox and they all now work when application/json is used, so I'm fine with using "application/json" by default going forward. When this was previously decided, it was the case that no major browsers supported that content-type. > V2 API returning wrong content-type > --- > > Key: SOLR-11266 > URL: https://issues.apache.org/jira/browse/SOLR-11266 > Project: Solr > Issue Type: Bug > Components: v2 API >Reporter: Ishan Chattopadhyaya >Priority: Major > Attachments: SOLR-11266.patch > > > The content-type of the returned value is wrong in many places. It should > return "application/json", but instead returns "application/text-plan". > Here's an example: > {code} > [ishan@t430 ~] $ curl -v > "http://localhost:8983/api/collections/products/select?q=*:*=0; > * Trying 127.0.0.1... > * TCP_NODELAY set > * Connected to localhost (127.0.0.1) port 8983 (#0) > > GET /api/collections/products/select?q=*:*=0 HTTP/1.1 > > Host: localhost:8983 > > User-Agent: curl/7.51.0 > > Accept: */* > > > < HTTP/1.1 200 OK > < Content-Type: text/plain;charset=utf-8 > < Content-Length: 184 > < > { > "responseHeader":{ > "zkConnected":true, > "status":0, > "QTime":1, > "params":{ > "q":"*:*", > "rows":"0"}}, > "response":{"numFound":260,"start":0,"docs":[] > }} > * Curl_http_done: called premature == 0 > * Connection #0 to host localhost left intact > {code} -- This message was sent by Atlassian JIRA (v7.6.14#76016) - To unsubscribe, e-mail: dev-unsubscr...@lucene.apache.org For additional commands, e-mail: dev-h...@lucene.apache.org
[jira] [Commented] (SOLR-11266) V2 API returning wrong content-type
[ https://issues.apache.org/jira/browse/SOLR-11266?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16889041#comment-16889041 ] Munendra S N commented on SOLR-11266: - [^SOLR-11266.patch] commented content-type in default config but left the content-type in sample techproducts config > V2 API returning wrong content-type > --- > > Key: SOLR-11266 > URL: https://issues.apache.org/jira/browse/SOLR-11266 > Project: Solr > Issue Type: Bug > Components: v2 API >Reporter: Ishan Chattopadhyaya >Priority: Major > Attachments: SOLR-11266.patch > > > The content-type of the returned value is wrong in many places. It should > return "application/json", but instead returns "application/text-plan". > Here's an example: > {code} > [ishan@t430 ~] $ curl -v > "http://localhost:8983/api/collections/products/select?q=*:*=0; > * Trying 127.0.0.1... > * TCP_NODELAY set > * Connected to localhost (127.0.0.1) port 8983 (#0) > > GET /api/collections/products/select?q=*:*=0 HTTP/1.1 > > Host: localhost:8983 > > User-Agent: curl/7.51.0 > > Accept: */* > > > < HTTP/1.1 200 OK > < Content-Type: text/plain;charset=utf-8 > < Content-Length: 184 > < > { > "responseHeader":{ > "zkConnected":true, > "status":0, > "QTime":1, > "params":{ > "q":"*:*", > "rows":"0"}}, > "response":{"numFound":260,"start":0,"docs":[] > }} > * Curl_http_done: called premature == 0 > * Connection #0 to host localhost left intact > {code} -- This message was sent by Atlassian JIRA (v7.6.14#76016) - To unsubscribe, e-mail: dev-unsubscr...@lucene.apache.org For additional commands, e-mail: dev-h...@lucene.apache.org
[jira] [Commented] (SOLR-11266) V2 API returning wrong content-type
[ https://issues.apache.org/jira/browse/SOLR-11266?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16888964#comment-16888964 ] Gus Heck commented on SOLR-11266: - {quote}Adding different config for browser would be maintenance headache. {quote} Yeah, if we don't want to pay that cost I'm fine with it. Just a suggestion how we could keep both. But yeah it's not free. > V2 API returning wrong content-type > --- > > Key: SOLR-11266 > URL: https://issues.apache.org/jira/browse/SOLR-11266 > Project: Solr > Issue Type: Bug > Components: v2 API >Reporter: Ishan Chattopadhyaya >Priority: Major > > The content-type of the returned value is wrong in many places. It should > return "application/json", but instead returns "application/text-plan". > Here's an example: > {code} > [ishan@t430 ~] $ curl -v > "http://localhost:8983/api/collections/products/select?q=*:*=0; > * Trying 127.0.0.1... > * TCP_NODELAY set > * Connected to localhost (127.0.0.1) port 8983 (#0) > > GET /api/collections/products/select?q=*:*=0 HTTP/1.1 > > Host: localhost:8983 > > User-Agent: curl/7.51.0 > > Accept: */* > > > < HTTP/1.1 200 OK > < Content-Type: text/plain;charset=utf-8 > < Content-Length: 184 > < > { > "responseHeader":{ > "zkConnected":true, > "status":0, > "QTime":1, > "params":{ > "q":"*:*", > "rows":"0"}}, > "response":{"numFound":260,"start":0,"docs":[] > }} > * Curl_http_done: called premature == 0 > * Connection #0 to host localhost left intact > {code} -- This message was sent by Atlassian JIRA (v7.6.14#76016) - To unsubscribe, e-mail: dev-unsubscr...@lucene.apache.org For additional commands, e-mail: dev-h...@lucene.apache.org
[jira] [Commented] (SOLR-11266) V2 API returning wrong content-type
[ https://issues.apache.org/jira/browse/SOLR-11266?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16888960#comment-16888960 ] Munendra S N commented on SOLR-11266: - {code:xml} text/plain; charset=UTF-8 {code} We could comment out this override sections with descriptions of what this does as additional comments. If any user need to override then, config API could be used or commented section could be uncommented. {quote}We could distribute _default with this corrected (removed), and have a _browser_example config also installed and available by default that does have this override.{quote} Adding different config for browser would be maintenance headache. > V2 API returning wrong content-type > --- > > Key: SOLR-11266 > URL: https://issues.apache.org/jira/browse/SOLR-11266 > Project: Solr > Issue Type: Bug > Components: v2 API >Reporter: Ishan Chattopadhyaya >Priority: Major > > The content-type of the returned value is wrong in many places. It should > return "application/json", but instead returns "application/text-plan". > Here's an example: > {code} > [ishan@t430 ~] $ curl -v > "http://localhost:8983/api/collections/products/select?q=*:*=0; > * Trying 127.0.0.1... > * TCP_NODELAY set > * Connected to localhost (127.0.0.1) port 8983 (#0) > > GET /api/collections/products/select?q=*:*=0 HTTP/1.1 > > Host: localhost:8983 > > User-Agent: curl/7.51.0 > > Accept: */* > > > < HTTP/1.1 200 OK > < Content-Type: text/plain;charset=utf-8 > < Content-Length: 184 > < > { > "responseHeader":{ > "zkConnected":true, > "status":0, > "QTime":1, > "params":{ > "q":"*:*", > "rows":"0"}}, > "response":{"numFound":260,"start":0,"docs":[] > }} > * Curl_http_done: called premature == 0 > * Connection #0 to host localhost left intact > {code} -- This message was sent by Atlassian JIRA (v7.6.14#76016) - To unsubscribe, e-mail: dev-unsubscr...@lucene.apache.org For additional commands, e-mail: dev-h...@lucene.apache.org
[jira] [Commented] (SOLR-11266) V2 API returning wrong content-type
[ https://issues.apache.org/jira/browse/SOLR-11266?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16887966#comment-16887966 ] Gus Heck commented on SOLR-11266: - For reference, this is the override from the configs: {code:xml} text/plain; charset=UTF-8 {code} We could distribute _default with this corrected (removed), and have a _browser_example config also installed and available by default that does have this override. A name like that should make it pretty clear which to select when going through examples in the ref guide or other publications, but not become what people automatically use as a starting point. > V2 API returning wrong content-type > --- > > Key: SOLR-11266 > URL: https://issues.apache.org/jira/browse/SOLR-11266 > Project: Solr > Issue Type: Bug > Components: v2 API >Reporter: Ishan Chattopadhyaya >Priority: Major > > The content-type of the returned value is wrong in many places. It should > return "application/json", but instead returns "application/text-plan". > Here's an example: > {code} > [ishan@t430 ~] $ curl -v > "http://localhost:8983/api/collections/products/select?q=*:*=0; > * Trying 127.0.0.1... > * TCP_NODELAY set > * Connected to localhost (127.0.0.1) port 8983 (#0) > > GET /api/collections/products/select?q=*:*=0 HTTP/1.1 > > Host: localhost:8983 > > User-Agent: curl/7.51.0 > > Accept: */* > > > < HTTP/1.1 200 OK > < Content-Type: text/plain;charset=utf-8 > < Content-Length: 184 > < > { > "responseHeader":{ > "zkConnected":true, > "status":0, > "QTime":1, > "params":{ > "q":"*:*", > "rows":"0"}}, > "response":{"numFound":260,"start":0,"docs":[] > }} > * Curl_http_done: called premature == 0 > * Connection #0 to host localhost left intact > {code} -- This message was sent by Atlassian JIRA (v7.6.14#76016) - To unsubscribe, e-mail: dev-unsubscr...@lucene.apache.org For additional commands, e-mail: dev-h...@lucene.apache.org
[jira] [Commented] (SOLR-11266) V2 API returning wrong content-type
[ https://issues.apache.org/jira/browse/SOLR-11266?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16886708#comment-16886708 ] Munendra S N commented on SOLR-11266: - [~gus_heck] Thanks for your insights. +1 to return Standard content-types. If someone needs to override the behavior then, it can be done by overriding content-type of the particular response writer. {quote}We should also be able to do Accept: negotiation and not require a url param relating to content type at all, at which point a browser that didn't accept json would likely fall back to text/plain...{quote} We should do this. I have linked SOLR-11760 which is on similar lines > V2 API returning wrong content-type > --- > > Key: SOLR-11266 > URL: https://issues.apache.org/jira/browse/SOLR-11266 > Project: Solr > Issue Type: Bug > Components: v2 API >Reporter: Ishan Chattopadhyaya >Priority: Major > > The content-type of the returned value is wrong in many places. It should > return "application/json", but instead returns "application/text-plan". > Here's an example: > {code} > [ishan@t430 ~] $ curl -v > "http://localhost:8983/api/collections/products/select?q=*:*=0; > * Trying 127.0.0.1... > * TCP_NODELAY set > * Connected to localhost (127.0.0.1) port 8983 (#0) > > GET /api/collections/products/select?q=*:*=0 HTTP/1.1 > > Host: localhost:8983 > > User-Agent: curl/7.51.0 > > Accept: */* > > > < HTTP/1.1 200 OK > < Content-Type: text/plain;charset=utf-8 > < Content-Length: 184 > < > { > "responseHeader":{ > "zkConnected":true, > "status":0, > "QTime":1, > "params":{ > "q":"*:*", > "rows":"0"}}, > "response":{"numFound":260,"start":0,"docs":[] > }} > * Curl_http_done: called premature == 0 > * Connection #0 to host localhost left intact > {code} -- This message was sent by Atlassian JIRA (v7.6.14#76016) - To unsubscribe, e-mail: dev-unsubscr...@lucene.apache.org For additional commands, e-mail: dev-h...@lucene.apache.org
[jira] [Commented] (SOLR-11266) V2 API returning wrong content-type
[ https://issues.apache.org/jira/browse/SOLR-11266?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16886363#comment-16886363 ] Gus Heck commented on SOLR-11266: - This behavior has been a peeve of mine... I've always found it irritating that the content type is not appropriate for the content. This forces clients to be written to make hard coded assumptions about content type (the most common solution), do checks to find out what was requested on the request line (or included in the POST data from the form), or to maintain state across the request or do any one of a number of other non-standard things rather than simply choose a parser based on content type. And that's if one has good control over that communications code. Could be even more fun if the client wants to use 3rd party code that refuses to ignore the header. I'm not of the opinion that users looking at a response in a browser are our main target audience. Javascript, Java, PHP and Python code probably constitute 1000x more use cases than humans in browser window inspection, which is mostly an initial development thing. If plain text is desired, that should be produced as the result of an override. Looking back at that the referenced issue, the number of folks rooting for application/json seemed way larger than those insisting on text/plain Standards are standards so that people can rely on them, and less inane glue-code is needed for systems to talk to each other. I never like to see software (be it open source or closed) half supporting or mutating or "extending" standards. I'm very +1 that we target returning sane content types that match the content actually returned for 9.x and provide a text/plain back compatibility option for the request params and also as a global config somewhere. It should not take special configuration to turn on "standards mode". We should also be able to do Accept: negotiation and not require a url param relating to content type at all, at which point a browser that didn't accept json would likely fall back to text/plain... > V2 API returning wrong content-type > --- > > Key: SOLR-11266 > URL: https://issues.apache.org/jira/browse/SOLR-11266 > Project: Solr > Issue Type: Bug > Components: v2 API >Reporter: Ishan Chattopadhyaya >Priority: Major > > The content-type of the returned value is wrong in many places. It should > return "application/json", but instead returns "application/text-plan". > Here's an example: > {code} > [ishan@t430 ~] $ curl -v > "http://localhost:8983/api/collections/products/select?q=*:*=0; > * Trying 127.0.0.1... > * TCP_NODELAY set > * Connected to localhost (127.0.0.1) port 8983 (#0) > > GET /api/collections/products/select?q=*:*=0 HTTP/1.1 > > Host: localhost:8983 > > User-Agent: curl/7.51.0 > > Accept: */* > > > < HTTP/1.1 200 OK > < Content-Type: text/plain;charset=utf-8 > < Content-Length: 184 > < > { > "responseHeader":{ > "zkConnected":true, > "status":0, > "QTime":1, > "params":{ > "q":"*:*", > "rows":"0"}}, > "response":{"numFound":260,"start":0,"docs":[] > }} > * Curl_http_done: called premature == 0 > * Connection #0 to host localhost left intact > {code} -- This message was sent by Atlassian JIRA (v7.6.14#76016) - To unsubscribe, e-mail: dev-unsubscr...@lucene.apache.org For additional commands, e-mail: dev-h...@lucene.apache.org
[jira] [Commented] (SOLR-11266) V2 API returning wrong content-type
[ https://issues.apache.org/jira/browse/SOLR-11266?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16886276#comment-16886276 ] Munendra S N commented on SOLR-11266: - Current behavior of V2 API is consistent with v1 API but when {{wt=json}} is passed explicitly, then content-type is {{text/plain}} (in both versions) this is due to SOLR-1123 (expected behavior) I'm not sure what should to be done here - resolve this since behavior is expected(from changeLog) or comment out the content-type override from the default configs?? [~ichattopadhyaya] please suggest > V2 API returning wrong content-type > --- > > Key: SOLR-11266 > URL: https://issues.apache.org/jira/browse/SOLR-11266 > Project: Solr > Issue Type: Bug > Components: v2 API >Reporter: Ishan Chattopadhyaya >Priority: Major > > The content-type of the returned value is wrong in many places. It should > return "application/json", but instead returns "application/text-plan". > Here's an example: > {code} > [ishan@t430 ~] $ curl -v > "http://localhost:8983/api/collections/products/select?q=*:*=0; > * Trying 127.0.0.1... > * TCP_NODELAY set > * Connected to localhost (127.0.0.1) port 8983 (#0) > > GET /api/collections/products/select?q=*:*=0 HTTP/1.1 > > Host: localhost:8983 > > User-Agent: curl/7.51.0 > > Accept: */* > > > < HTTP/1.1 200 OK > < Content-Type: text/plain;charset=utf-8 > < Content-Length: 184 > < > { > "responseHeader":{ > "zkConnected":true, > "status":0, > "QTime":1, > "params":{ > "q":"*:*", > "rows":"0"}}, > "response":{"numFound":260,"start":0,"docs":[] > }} > * Curl_http_done: called premature == 0 > * Connection #0 to host localhost left intact > {code} -- This message was sent by Atlassian JIRA (v7.6.14#76016) - To unsubscribe, e-mail: dev-unsubscr...@lucene.apache.org For additional commands, e-mail: dev-h...@lucene.apache.org
[jira] [Commented] (SOLR-11266) V2 API returning wrong content-type
[ https://issues.apache.org/jira/browse/SOLR-11266?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16789248#comment-16789248 ] Munendra S N commented on SOLR-11266: - [~ichattopadhyaya] This is because of the difference in the way default response writer is resolved in V2API and V1API. In default config, JSON responsewriter contentType is overridden to application/text-plain. Previously, V2 API when wt is not passed set wt param to json and resolved response writer. Here, the writer returned would be from PluginBag(which has JSON response writer with overridden contentType) Whereas, In V1 API when wt is not passed didn't set wt param and resolved responsed writer. (returns response writer default response writer which hasn't overridden contentType) As part of SOLR-13284, V2 API getResponseWriter behavior is made same as V1 API. Even without this change, if the user passed wt=json, then both APIs would return content-type as application/text-plain due to content-type override from config > V2 API returning wrong content-type > --- > > Key: SOLR-11266 > URL: https://issues.apache.org/jira/browse/SOLR-11266 > Project: Solr > Issue Type: Bug > Security Level: Public(Default Security Level. Issues are Public) > Components: v2 API >Reporter: Ishan Chattopadhyaya >Priority: Major > > The content-type of the returned value is wrong in many places. It should > return "application/json", but instead returns "application/text-plan". > Here's an example: > {code} > [ishan@t430 ~] $ curl -v > "http://localhost:8983/api/collections/products/select?q=*:*=0; > * Trying 127.0.0.1... > * TCP_NODELAY set > * Connected to localhost (127.0.0.1) port 8983 (#0) > > GET /api/collections/products/select?q=*:*=0 HTTP/1.1 > > Host: localhost:8983 > > User-Agent: curl/7.51.0 > > Accept: */* > > > < HTTP/1.1 200 OK > < Content-Type: text/plain;charset=utf-8 > < Content-Length: 184 > < > { > "responseHeader":{ > "zkConnected":true, > "status":0, > "QTime":1, > "params":{ > "q":"*:*", > "rows":"0"}}, > "response":{"numFound":260,"start":0,"docs":[] > }} > * Curl_http_done: called premature == 0 > * Connection #0 to host localhost left intact > {code} -- This message was sent by Atlassian JIRA (v7.6.3#76005) - To unsubscribe, e-mail: dev-unsubscr...@lucene.apache.org For additional commands, e-mail: dev-h...@lucene.apache.org