[ 
https://issues.apache.org/jira/browse/COUCHDB-3145?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Sergey Korobkov updated COUCHDB-3145:
-------------------------------------
    Comment: was deleted

(was: Sorry for late answer.
Current master of couchdb-fauxton had fixed this problem.

To build it I had to modify in rebar.config.script  fauxton version to
{fauxton, "fauxton", {branch, "master"}, [raw]}
because {tag, "v1.1.9"} doesn't have this fix.

Thank you.)

> Double encoding in URI with slash and hypen in DB name
> ------------------------------------------------------
>
>                 Key: COUCHDB-3145
>                 URL: https://issues.apache.org/jira/browse/COUCHDB-3145
>             Project: CouchDB
>          Issue Type: Bug
>          Components: Fauxton
>    Affects Versions: 2.0.0, 1.7.0
>            Reporter: Sergey Korobkov
>
> When creating database with hyphen and slash in its name, Fauxten cant list 
> this name in list all DB ( _all_dbs ).
> If DB name with only hyphen or slash - ewerithing is OK.
> !http://storage7.static.itmages.com/i/16/0913/h_1473754249_7427493_402eec3fa3.png!
> In log list all DBs looks like this:
> {quote}
> [notice] 2016-09-13T08:16:21.343173Z couchdb@localhost <0.11290.0> 23a0d97781 
> X.X.X.X:5984 Y.Y.Y.Y admin GET /_all_dbs?_=1473754580639 200 ok 3 
> [notice] 2016-09-13T08:16:21.470890Z couchdb@localhost <0.11290.0> bd26963777 
> X.X.X.X:5984 Y.Y.Y.Y admin GET /_global_changes 200 ok 2 
> [notice] 2016-09-13T08:16:21.471687Z couchdb@localhost <0.10814.0> b30d1037bf 
> X.X.X.X:5984 Y.Y.Y.Y admin GET /_metadata 200 ok 2 
> [notice] 2016-09-13T08:16:21.473135Z couchdb@localhost <0.10833.0> d00c53a85d 
> X.X.X.X:5984 Y.Y.Y.Y admin GET /_replicator 200 ok 2 
> [notice] 2016-09-13T08:16:21.474227Z couchdb@localhost <0.11068.0> 7916c73be5 
> X.X.X.X:5984 Y.Y.Y.Y admin GET /_users 200 ok 2 
> [notice] 2016-09-13T08:16:21.475637Z couchdb@localhost <0.10816.0> addcc98b40 
> X.X.X.X:5984 Y.Y.Y.Y admin GET /test- 200 ok 2 
> [notice] 2016-09-13T08:16:21.476310Z couchdb@localhost <0.10815.0> 578f9f27d2 
> X.X.X.X:5984 Y.Y.Y.Y undefined GET /test-%252F- 404 ok 1 
> [notice] 2016-09-13T08:16:21.531812Z couchdb@localhost <0.10814.0> 618f84d6df 
> X.X.X.X:5984 Y.Y.Y.Y admin GET /test%2F 200 ok 2 
> [notice] 2016-09-13T08:16:21.534608Z couchdb@localhost <0.10833.0> 70e91d0260 
> X.X.X.X:5984 Y.Y.Y.Y admin GET /test%2Ftest%2Ftest 200 ok 2 
> {quote}
> Fauxton try *GET /test-%252F-* not */test-%2F-*
> So its call encodeURIComponent() twice on this type of URI and on second run 
> its encode % to %25 ( / --> *%2F* --> *%252F* )
> I beleive bug in "app/core/utils.js" in function "utils.safeURLName()":
> {quote}
> {noformat}
>   safeURLName: function (name) {
>     var testName = name || "";
>     var checkforBad = testName.match(/[\$\-/,+-]/g);
>     return (checkforBad !== null) ? encodeURIComponent(name) : name;
>   },
> {noformat}
> {quote}
> If remove all hyphens from {noformat}/[\$\-/,+-]/g{noformat} then DB list 
> correctly.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to