[jira] [Commented] (SOLR-5517) Treat POST with no Content-Type as application/x-www-form-urlencoded
[ https://issues.apache.org/jira/browse/SOLR-5517?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=13835997#comment-13835997 ] Uwe Schindler commented on SOLR-5517: - That looks perfect. I have not yet tested it, but from what I see: the RAW parser will no longer automatically invoked with missing content type. There may be another bug in the raw parser, but that is another issue: The raw parser seems to ignore request parameters given in the URL query string. Treat POST with no Content-Type as application/x-www-form-urlencoded Key: SOLR-5517 URL: https://issues.apache.org/jira/browse/SOLR-5517 Project: Solr Issue Type: Improvement Reporter: Ryan Ernst Attachments: SOLR-5517.patch, SOLR-5517.patch While the http spec states requests without a content-type should be treated as application/octet-stream, the html spec says instead that post requests without a content-type should be treated as a form (http://www.w3.org/MarkUp/html-spec/html-spec_8.html#SEC8.2.1). It would be nice to allow large search requests from html forms, and not have to rely on the browser to set the content type (since the spec says it doesn't have to). -- This message was sent by Atlassian JIRA (v6.1#6144) - To unsubscribe, e-mail: dev-unsubscr...@lucene.apache.org For additional commands, e-mail: dev-h...@lucene.apache.org
[jira] [Commented] (SOLR-5517) Treat POST with no Content-Type as application/x-www-form-urlencoded
[ https://issues.apache.org/jira/browse/SOLR-5517?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=13835759#comment-13835759 ] Robert Muir commented on SOLR-5517: --- +1 Treat POST with no Content-Type as application/x-www-form-urlencoded Key: SOLR-5517 URL: https://issues.apache.org/jira/browse/SOLR-5517 Project: Solr Issue Type: Improvement Reporter: Ryan Ernst Attachments: SOLR-5517.patch While the http spec states requests without a content-type should be treated as application/octet-stream, the html spec says instead that post requests without a content-type should be treated as a form (http://www.w3.org/MarkUp/html-spec/html-spec_8.html#SEC8.2.1). It would be nice to allow large search requests from html forms, and not have to rely on the browser to set the content type (since the spec says it doesn't have to). -- This message was sent by Atlassian JIRA (v6.1#6144) - To unsubscribe, e-mail: dev-unsubscr...@lucene.apache.org For additional commands, e-mail: dev-h...@lucene.apache.org
[jira] [Commented] (SOLR-5517) Treat POST with no Content-Type as application/x-www-form-urlencoded
[ https://issues.apache.org/jira/browse/SOLR-5517?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=13835776#comment-13835776 ] Uwe Schindler commented on SOLR-5517: - -1, I don't like this automatisms. Especially as the specs don't agree (HTML vs. HTTP). Just the question: Which browser, not older than 15 years, still does ot send a content type? Uwe Treat POST with no Content-Type as application/x-www-form-urlencoded Key: SOLR-5517 URL: https://issues.apache.org/jira/browse/SOLR-5517 Project: Solr Issue Type: Improvement Reporter: Ryan Ernst Attachments: SOLR-5517.patch While the http spec states requests without a content-type should be treated as application/octet-stream, the html spec says instead that post requests without a content-type should be treated as a form (http://www.w3.org/MarkUp/html-spec/html-spec_8.html#SEC8.2.1). It would be nice to allow large search requests from html forms, and not have to rely on the browser to set the content type (since the spec says it doesn't have to). -- This message was sent by Atlassian JIRA (v6.1#6144) - To unsubscribe, e-mail: dev-unsubscr...@lucene.apache.org For additional commands, e-mail: dev-h...@lucene.apache.org
[jira] [Commented] (SOLR-5517) Treat POST with no Content-Type as application/x-www-form-urlencoded
[ https://issues.apache.org/jira/browse/SOLR-5517?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=13835779#comment-13835779 ] Robert Muir commented on SOLR-5517: --- I disagree that the http spec says unknown content-type should be application/octet stream. It does not really say this, you have to read it all in context. HTTP: (discussing content-type in general, and not POST in particular) {quote} If and only if the media type is not given by a Content-Type field, the recipient MAY attempt to guess the media type via inspection of its content and/or the name extension(s) of the URL used to identify the resource. *If the media type remains unknown*, the recipient SHOULD treat it as type application/octet-stream {quote} Treat POST with no Content-Type as application/x-www-form-urlencoded Key: SOLR-5517 URL: https://issues.apache.org/jira/browse/SOLR-5517 Project: Solr Issue Type: Improvement Reporter: Ryan Ernst Attachments: SOLR-5517.patch While the http spec states requests without a content-type should be treated as application/octet-stream, the html spec says instead that post requests without a content-type should be treated as a form (http://www.w3.org/MarkUp/html-spec/html-spec_8.html#SEC8.2.1). It would be nice to allow large search requests from html forms, and not have to rely on the browser to set the content type (since the spec says it doesn't have to). -- This message was sent by Atlassian JIRA (v6.1#6144) - To unsubscribe, e-mail: dev-unsubscr...@lucene.apache.org For additional commands, e-mail: dev-h...@lucene.apache.org
[jira] [Commented] (SOLR-5517) Treat POST with no Content-Type as application/x-www-form-urlencoded
[ https://issues.apache.org/jira/browse/SOLR-5517?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=13835783#comment-13835783 ] Uwe Schindler commented on SOLR-5517: - As said, I disagree with this change for the same reasons why something like guessing the charset is wrong, too. This is my personal opinion, you may or may not share it. I just add: Browsers still not sending the content type, for sure also send the stuff ISO-8859-1 URL-encoded, which would be not accepted by Solr, too. My question was: Which browsers don't support this? Treat POST with no Content-Type as application/x-www-form-urlencoded Key: SOLR-5517 URL: https://issues.apache.org/jira/browse/SOLR-5517 Project: Solr Issue Type: Improvement Reporter: Ryan Ernst Attachments: SOLR-5517.patch While the http spec states requests without a content-type should be treated as application/octet-stream, the html spec says instead that post requests without a content-type should be treated as a form (http://www.w3.org/MarkUp/html-spec/html-spec_8.html#SEC8.2.1). It would be nice to allow large search requests from html forms, and not have to rely on the browser to set the content type (since the spec says it doesn't have to). -- This message was sent by Atlassian JIRA (v6.1#6144) - To unsubscribe, e-mail: dev-unsubscr...@lucene.apache.org For additional commands, e-mail: dev-h...@lucene.apache.org
[jira] [Commented] (SOLR-5517) Treat POST with no Content-Type as application/x-www-form-urlencoded
[ https://issues.apache.org/jira/browse/SOLR-5517?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=13835840#comment-13835840 ] Robert Muir commented on SOLR-5517: --- The problem can happen when users write HTTP code themselves, for example if they are using httpclient and use StringEntity(URLEncodedUtils(...)) versus URLEncodedFormEntity. They are the same, except the latter sets Content-Type to form data. The current default when content-type is not specified returns xml with no results, which can be confusing. All the solr POST examples (e.g. upload) on the wiki tell you that you should send this header. If its missing, returning 415 Unsupported Media Type or some similar error would be another option: returning no results is hard to debug. Treat POST with no Content-Type as application/x-www-form-urlencoded Key: SOLR-5517 URL: https://issues.apache.org/jira/browse/SOLR-5517 Project: Solr Issue Type: Improvement Reporter: Ryan Ernst Attachments: SOLR-5517.patch While the http spec states requests without a content-type should be treated as application/octet-stream, the html spec says instead that post requests without a content-type should be treated as a form (http://www.w3.org/MarkUp/html-spec/html-spec_8.html#SEC8.2.1). It would be nice to allow large search requests from html forms, and not have to rely on the browser to set the content type (since the spec says it doesn't have to). -- This message was sent by Atlassian JIRA (v6.1#6144) - To unsubscribe, e-mail: dev-unsubscr...@lucene.apache.org For additional commands, e-mail: dev-h...@lucene.apache.org
[jira] [Commented] (SOLR-5517) Treat POST with no Content-Type as application/x-www-form-urlencoded
[ https://issues.apache.org/jira/browse/SOLR-5517?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=13835839#comment-13835839 ] Uwe Schindler commented on SOLR-5517: - In my opinion, we should for this case not fallback to something like the crazy RAW parser (I agree, this is wrong and leads to confusion). Instead we should return a better HTTP status like: {quote} 415 Unsupported Media Type The request entity has a media type which the server or resource does not support.[2] For example, the client uploads an image as image/svg+xml, but the server requires that images use a different format. {quote} This can be done by throwing SolrException with 415 as status code. Treat POST with no Content-Type as application/x-www-form-urlencoded Key: SOLR-5517 URL: https://issues.apache.org/jira/browse/SOLR-5517 Project: Solr Issue Type: Improvement Reporter: Ryan Ernst Attachments: SOLR-5517.patch While the http spec states requests without a content-type should be treated as application/octet-stream, the html spec says instead that post requests without a content-type should be treated as a form (http://www.w3.org/MarkUp/html-spec/html-spec_8.html#SEC8.2.1). It would be nice to allow large search requests from html forms, and not have to rely on the browser to set the content type (since the spec says it doesn't have to). -- This message was sent by Atlassian JIRA (v6.1#6144) - To unsubscribe, e-mail: dev-unsubscr...@lucene.apache.org For additional commands, e-mail: dev-h...@lucene.apache.org
[jira] [Commented] (SOLR-5517) Treat POST with no Content-Type as application/x-www-form-urlencoded
[ https://issues.apache.org/jira/browse/SOLR-5517?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=13835838#comment-13835838 ] Jack Krupansky commented on SOLR-5517: -- What about curl commands? It is kind of an annoyance that you have to explicitly enter a Content-type. Treat POST with no Content-Type as application/x-www-form-urlencoded Key: SOLR-5517 URL: https://issues.apache.org/jira/browse/SOLR-5517 Project: Solr Issue Type: Improvement Reporter: Ryan Ernst Attachments: SOLR-5517.patch While the http spec states requests without a content-type should be treated as application/octet-stream, the html spec says instead that post requests without a content-type should be treated as a form (http://www.w3.org/MarkUp/html-spec/html-spec_8.html#SEC8.2.1). It would be nice to allow large search requests from html forms, and not have to rely on the browser to set the content type (since the spec says it doesn't have to). -- This message was sent by Atlassian JIRA (v6.1#6144) - To unsubscribe, e-mail: dev-unsubscr...@lucene.apache.org For additional commands, e-mail: dev-h...@lucene.apache.org
[jira] [Commented] (SOLR-5517) Treat POST with no Content-Type as application/x-www-form-urlencoded
[ https://issues.apache.org/jira/browse/SOLR-5517?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=13835843#comment-13835843 ] Robert Muir commented on SOLR-5517: --- {quote} What about curl commands? It is kind of an annoyance that you have to explicitly enter a Content-type. {quote} Curl automatically populates this header itself (unless you change it explicitly to something else), so its no problem. Again: the problem is someone writing their own client code, they can send exact same URL/params as curl, but instead just get no results: which is really confusing. All of their parameters are silently ignored. Treat POST with no Content-Type as application/x-www-form-urlencoded Key: SOLR-5517 URL: https://issues.apache.org/jira/browse/SOLR-5517 Project: Solr Issue Type: Improvement Reporter: Ryan Ernst Attachments: SOLR-5517.patch While the http spec states requests without a content-type should be treated as application/octet-stream, the html spec says instead that post requests without a content-type should be treated as a form (http://www.w3.org/MarkUp/html-spec/html-spec_8.html#SEC8.2.1). It would be nice to allow large search requests from html forms, and not have to rely on the browser to set the content type (since the spec says it doesn't have to). -- This message was sent by Atlassian JIRA (v6.1#6144) - To unsubscribe, e-mail: dev-unsubscr...@lucene.apache.org For additional commands, e-mail: dev-h...@lucene.apache.org
[jira] [Commented] (SOLR-5517) Treat POST with no Content-Type as application/x-www-form-urlencoded
[ https://issues.apache.org/jira/browse/SOLR-5517?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=13835845#comment-13835845 ] Uwe Schindler commented on SOLR-5517: - Hi, I looked up what Jetty by default is doing, here is it: [https://github.com/eclipse/jetty.project/blob/e92f44ed73453d6107a30ba42600787963c6243d/jetty-server/src/main/java/org/eclipse/jetty/server/Request.java#L288] Actually it only parses the stuff if a content-type is set and the method is POST/PUT. So our code is doing the same (because we dont use Jetty's parameter decoding, as its not felxible enough with charsets). Treat POST with no Content-Type as application/x-www-form-urlencoded Key: SOLR-5517 URL: https://issues.apache.org/jira/browse/SOLR-5517 Project: Solr Issue Type: Improvement Reporter: Ryan Ernst Attachments: SOLR-5517.patch While the http spec states requests without a content-type should be treated as application/octet-stream, the html spec says instead that post requests without a content-type should be treated as a form (http://www.w3.org/MarkUp/html-spec/html-spec_8.html#SEC8.2.1). It would be nice to allow large search requests from html forms, and not have to rely on the browser to set the content type (since the spec says it doesn't have to). -- This message was sent by Atlassian JIRA (v6.1#6144) - To unsubscribe, e-mail: dev-unsubscr...@lucene.apache.org For additional commands, e-mail: dev-h...@lucene.apache.org