[
https://issues.apache.org/jira/browse/SOLR-4265?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13544318#comment-13544318
]
Uwe Schindler commented on SOLR-4265:
-------------------------------------
I started here and added a new forbidden API file for Solr:
{noformat}
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not use this file except in compliance with
# the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# These methods from the Servlet API should not be used, because they are
# either broken and slow in some environments (e.g., Jetty's UTF-8 readers),
# or the parsing of request parameters is not using the correct encoding
# without extra configuration in the servlet container:
javax.servlet.ServletRequest#getReader()
javax.servlet.ServletRequest#getParameter(java.lang.String)
javax.servlet.ServletRequest#getParameterMap()
javax.servlet.ServletRequest#getParameterNames()
javax.servlet.ServletRequest#getParameterValues(java.lang.String)
javax.servlet.ServletResponse#getWriter()
{noformat}
It looks actuall quite good. Only SolrRequestParser and SolrParsm uses the
parameter methods, but we can remove those methods. Interestingly
SolrDispatchFilter only uses the Parameter maps for GET request, POST is
handled automatically in a correct way (also the URL parameters). So the fix is
easy: Just use the method from SolrRequestParsers also for GET and not only for
post and pass the result to MultiParams.
The remaining issues are the use of getReader() and getWriter() in Zookeeper
servlets. We should fix that, too. getReader/getWriter is slow and broken for
supplementary chars in Jetty and possibly other servers. We should always use
InputStreams/OutputStreams and wrap the reader ourselves (like we do in
DispatchFilter).
> Encoding problem from test console
> ----------------------------------
>
> Key: SOLR-4265
> URL: https://issues.apache.org/jira/browse/SOLR-4265
> Project: Solr
> Issue Type: Bug
> Components: web gui
> Affects Versions: 4.0
> Environment: Windows but, environment independent
> Reporter: Alex Rocher
> Priority: Blocker
> Attachments: SolrDispatchFilter.java.patch
>
>
> When you type an accent (in french language for example) in the console query
> tester, there's no charset conversion (servlet request charset conversion)
> Eg.: "même" is converted into it's ISO-8859-1 representation ==> fail
> The reason : getCharacterEncoding from HTTPRequest is not tested. Il it's
> null, il will assume to convert an UTF-8 encoding charset.
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]