Details
-
Bug
-
Resolution: Unresolved
-
Major
-
7.2.0
-
Untriaged
-
0
-
Unknown
Description
While investigating CBSE-16961 I discovered that the document viewer UI fails to display some of the documents when a document ID contains the null character. I'm not sure why anyone would want a document ID containing a null character, but KV supports them, so the UI should as well.
Here is an example of the problem. The BadNames default collection has a null character at the beginning of the id. When displayed, the summary says 4 results, but the null character stops the HTML rendering of the results:
The fix is quite simple. The null character is confusing the HTML rendering, so the code needs to replace it with something else. The following example shows the same results with null replaced by ^@
How to create a document with a null character in the id? The UI does not permit this, but it can be done with the documents REST API:
curl -H "Content-Type: application/x-www-form-urlencoded; charset=UTF-8" -X POST -d 'flags=33554438&value=%7B%22hello%22%3A%20%22world%22%7D' http://Administrator:<password>@localhost:9000/pools/default/buckets/BadNames/scopes/_default/collections/_default/docs/%00key2
Attachments
Gerrit Reviews
For Gerrit Dashboard: MB-61819 | ||||||
---|---|---|---|---|---|---|
# | Subject | Branch | Project | Status | CR | V |
209734,3 | MB-61819 - allow document UI to show documents with null character in ID | master | query-ui | Status: MERGED | +2 | +1 |