You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@lucene.apache.org by "David Smiley (Jira)" <ji...@apache.org> on 2020/07/31 16:12:00 UTC
[jira] [Commented] (SOLR-14699) Solr request logs should escape
names, values (SolrQueryResponse.getToLogAsString)
[ https://issues.apache.org/jira/browse/SOLR-14699?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17168973#comment-17168973 ]
David Smiley commented on SOLR-14699:
-------------------------------------
It'd be convenient if the change was minimally disruptive such that typical logs don't change.
It'd also be nice if SolrJ or its dependencies, including the JDK itself made parsing this easy.
One possibility is conditionally using URLEncoder on the name and value parts if the characters contain a "%", "=", or " ". URLEncoding will then produce a string that contains a %, and the client can look for the "%" to know it has to use the decoder. An option to consider is wether the encoding should always convert spaces to %20 to make parsing easier albeit plain logs looking uglier, or not but the client would need to look for not just a "%" but also a "+" to decide to use URLDecoder.
This change should probably be done in 9.0 to not impact users on 8.x.
WDYT [~jbernste] [~matmarie]?
> Solr request logs should escape names, values (SolrQueryResponse.getToLogAsString)
> ----------------------------------------------------------------------------------
>
> Key: SOLR-14699
> URL: https://issues.apache.org/jira/browse/SOLR-14699
> Project: Solr
> Issue Type: Improvement
> Security Level: Public(Default Security Level. Issues are Public)
> Components: logging
> Reporter: David Smiley
> Priority: Minor
>
> {{SolrQueryResponse.getToLogAsString}} encodes the NamedList into a String with simple space-separated pairs with name=value. However, it does no escaping/encoding, and as-such a value might itself contain spaces and equals. This is a problem if these logs are being parsed, and we'd like to ensure we do so correctly. Note that SolrLogPostTool (aka "postlogs") parses these logs.
--
This message was sent by Atlassian Jira
(v8.3.4#803005)
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@lucene.apache.org
For additional commands, e-mail: issues-help@lucene.apache.org