-
Notifications
You must be signed in to change notification settings - Fork 2
Open
Description
Issue
There are at least 2 cases where an asterisk will not be decoded properly. I have discovered the following but there could be more examples:
- If the first character in a string is an asterisk. Eg.
* hello
.
var query = '* hello';
var encoded = juri().encodeString(query); // encoded = "*_hello"
var decoded = juri().decodeString(encoded); //decoded = "_hello"
- If an asterisk is next to another special character in the middle of a string. Eg.
name_*
.
var query = 'name_';
var encoded = juri().encodeString(query); // encoded = "name~S"
var decoded = juri().decodeString(encoded); //decoded = "name~undefined"
I believe this is caused by the asterisk being used as part of the dictionary feature. The two cases are not properly handled.
Workaround
The workaround is to add an asterisk to the dictionary when instantiating juri:
var juri = require('juri')(['*']);
Metadata
Metadata
Assignees
Labels
No labels