Hi guys,

If you go to any URL with your browser, both %2f and / are treated the same.

These two URLs are exactly the same, irrespective of encoding:

http://localhost:7474/db/data/index/node/mynodes/mykey/my%2fvalue

http://localhost:7474/db/data/index/node/mynodes/mykey/my/value

neo4j seems to use a very basic parsing routine - just splitting on the slashes 
- instead of a full URI parser.

Using the encoded format, we *can* successfully create an index entry with a 
slash in the value:



curl -i -H Content-Type:application/json -X POST -d 
'"http://localhost:7474/db/data/node/0";'<http://localhost:7474/db/data/node/0%22'son>
 'http://localhost:7474/db/data/index/node/mynodes/mykey/my%2fvalue'


Without the encoding, it results in a 405 response:



curl -i -H Content-Type:application/json -X POST -d 
'"http://localhost:7474/db/data/node/0";'<http://localhost:7474/db/data/node/0%22'son>
 'http://localhost:7474/db/data/index/node/mynodes/mykey/my/value'

The issue we are facing is that the web client we are using in .NET unwraps the 
URL into a canonical format before sending the request. When it does this, it 
decodes the %2f back to a slash.

It would take a reasonable amount of work for us to bypass this. I'm not very 
comfortable going to that effort considering it's all dependent on neo4j's 
specific URL parser implementation. If this is upgraded to a compliant parser 
in the future, our workaround will break.

Is there a way for us to pass index values in a query string or POST body?

For example:


curl -i -H Content-Type:application/json -X POST -d 
'"http://localhost:7474/db/data/node/0";'<http://localhost:7474/db/data/node/0%22'son>
 
'http://localhost:7474/db/data/index/node?indexname=mynodes&indexkey=mykey&indexvalue=my%2fvalue'<http://localhost:7474/db/data/index/node?IndexName=mynodes&mykey=my%2fvalue'>


--
Tatham Oddie
au mob: +61 414 275 989, us cell: +1 415 598 8201, skype: tathamoddie
If you're printing this email, you're doing it wrong. This is a computer, not a 
typewriter.

_______________________________________________
Neo4j mailing list
[email protected]
https://lists.neo4j.org/mailman/listinfo/user

Reply via email to