neo4j/community — pull request #489 by editor (2012-05-04 00:08:22+00:00)
Title: URI encoding index key/value pairs

When using the Web Admin, the app has trouble routing index key/value pairs with slashes in them.

Index queries can handle both:

http://localhost:7474/db/data/index/node/CONTENT_IDX/?query=i:this/and/that

and

http://localhost:7474/db/data/index/node/CONTENT_IDX/?query=i:this%2Fand%2Fthat

However, direct gets to the same element will break as the router is (understandably) confused by the slashes:

http://localhost:7474/db/data/index/node/CONTENT_IDX/i/this/and/that

This problem is resolved by using encodeURIComponent() on the values:

http://localhost:7474/db/data/index/node/CONTENT_IDX/i/this%2Fand%2Fthat

When using the index lookup tool (http://localhost:7474/db/data/index/node/), for example, values used in urls should be encoded.

Since queries can support both and direct gets can only support the one I feel the best solution is to update the ItemUrlResolver.coffee to encode the key/values that come from user input.