• Tristan Cavelier's avatar
    fixup : query: fix ending backslash in query serialization · 82662091
    Tristan Cavelier authored
    The commit should now be rephrased to : query: fix some query value serialization issues
    
    * Double quotes are not escaped :
    
    When bulding a query from a JSON object, if a simple query
    value contained double quotes, then they were not escaped.
    
    Stringifying `{type: "simple", value: "\"hello\""}` results :
    - before ` ""hello""`, which is a weird query ;
    - now ` "\"hello\""`, which is ok.
    
    * Ending backslash causes invalid query :
    
    We now lose the ending backslash during the serialization
    in order to build a valid query string.
    
    Stringifying `{type: "simple", value: "hello\\"}` results :
    - before ` "hello\"`, which is an invalid query string ;
    - now ` hello\`, which is ok.
    82662091
query.js 31.5 KB