CouchDB
  1. CouchDB
  2. COUCHDB-1166

See if the U+2028 character breaks JSONP

    Details

    • Type: Improvement Improvement
    • Status: Reopened
    • Priority: Minor Minor
    • Resolution: Unresolved
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: None
    • Labels:
      None
    • Skill Level:
      New Contributors Level (Easy)

      Description

      We should see if we need to fix our JSON responses over JSONP according to http://timelessrepo.com/json-isnt-a-javascript-subset

        Activity

        Hide
        Paul Joseph Davis added a comment -

        Not paying much attention but I think that ejson has an issue here. we should think of a JS or Etap test for this to be safe I think.

        Show
        Paul Joseph Davis added a comment - Not paying much attention but I think that ejson has an issue here. we should think of a JS or Etap test for this to be safe I think.
        Randall Leeds made changes -
        Assignee Paul Joseph Davis [ paul.joseph.davis ]
        Hide
        Randall Leeds added a comment -

        Assigning to davisp after his last comment.

        Show
        Randall Leeds added a comment - Assigning to davisp after his last comment.
        Hide
        Paul Joseph Davis added a comment -

        Ruh roh.

        1> Val = ejson:decode(<<"\"\\u2028\"">>).
        <<226,128,168>>
        2> ejson:encode(Val).
        <<34,226,128,168,34>>

        This is from the ejson that's in trunk.

        Show
        Paul Joseph Davis added a comment - Ruh roh. 1> Val = ejson:decode(<<"\"\\u2028\"">>). <<226,128,168>> 2> ejson:encode(Val). <<34,226,128,168,34>> This is from the ejson that's in trunk.
        Paul Joseph Davis made changes -
        Resolution Not A Problem [ 8 ]
        Status Resolved [ 5 ] Reopened [ 4 ]
        Hide
        Paul Joseph Davis added a comment -

        Whoops, forgot to check ejson. Pretty sure it escapes, but it's better to check.

        Show
        Paul Joseph Davis added a comment - Whoops, forgot to check ejson. Pretty sure it escapes, but it's better to check.
        Paul Joseph Davis made changes -
        Field Original Value New Value
        Status Open [ 1 ] Resolved [ 5 ]
        Resolution Not A Problem [ 8 ]
        Hide
        Paul Joseph Davis added a comment -

        We \u escape all output. Mochijson2 is configurable to output utf8, but we don't expose that options.

        Eshell V5.8.1 (abort with ^G)
        1> Val = mochijson2:decode(<<"\"\\u2028\"">>).
        <<226,128,168>>
        2> mochijson2:encode(Val).
        [34,"\\u2028",34]
        3>

        Show
        Paul Joseph Davis added a comment - We \u escape all output. Mochijson2 is configurable to output utf8, but we don't expose that options. Eshell V5.8.1 (abort with ^G) 1> Val = mochijson2:decode(<<"\"\\u2028\"">>). <<226,128,168>> 2> mochijson2:encode(Val). [34,"\\u2028",34] 3>
        Jan Lehnardt created issue -

          People

          • Assignee:
            Paul Joseph Davis
            Reporter:
            Jan Lehnardt
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:

              Development