Issue #2391 - JSON Solidus is optional for escaping
Signed-off-by: Joakim Erdfelt <joakim.erdfelt@gmail.com>
This commit is contained in:
parent
5cab0ccd5f
commit
46c5824e7a
|
@ -273,7 +273,9 @@ public class JSON
|
|||
if ((c >= 0x20) && (c <= 0x7E))
|
||||
{
|
||||
// Special cases for quotation-mark, reverse-solidus, and solidus
|
||||
if ((c == '"') || (c == '\\') || (c == '/'))
|
||||
if ((c == '"') || (c == '\\')
|
||||
/* solidus is optional - per Carsten Bormann (IETF)
|
||||
|| (c == '/') */)
|
||||
{
|
||||
buffer.append('\\').append(c);
|
||||
}
|
||||
|
|
|
@ -363,7 +363,7 @@ public class JSONTest
|
|||
json.append(buf,map);
|
||||
String js=buf.toString();
|
||||
|
||||
assertTrue(js.indexOf("\"date\":\"01\\/01\\/1970 00:00:00 GMT\"")>=0);
|
||||
assertTrue(js.indexOf("\"date\":\"01/01/1970 00:00:00 GMT\"")>=0);
|
||||
assertTrue(js.indexOf("org.eclipse.jetty.util.ajax.JSONTest$Woggle")>=0);
|
||||
assertTrue(js.indexOf("org.eclipse.jetty.util.ajax.JSONTest$Gizmo")<0);
|
||||
assertTrue(js.indexOf("\"tested\":true")>=0);
|
||||
|
|
Loading…
Reference in New Issue