diff --git a/java/server/src/org/openqa/selenium/server/commands/CaptureNetworkTrafficCommand.java b/java/server/src/org/openqa/selenium/server/commands/CaptureNetworkTrafficCommand.java index ddb8e923310f9..b3cf965093224 100644 --- a/java/server/src/org/openqa/selenium/server/commands/CaptureNetworkTrafficCommand.java +++ b/java/server/src/org/openqa/selenium/server/commands/CaptureNetworkTrafficCommand.java @@ -207,24 +207,18 @@ private String jsonKey(final String key) { } private Object json(String s) { - return escape(s); - } - - // -------------- Copied from JSONValue ------------------- - /** - * Escape quotes, \, /, \r, \n, \b, \f, \t and other control characters (U+0000 through U+001F). - * @param s - * @return - */ - private static String escape(String s){ if(s==null) return null; StringBuffer sb = new StringBuffer(); + sb.append("\""); escape(s, sb); + sb.append("\""); return sb.toString(); } + // -------------- Copied from JSONValue ------------------- /** + * Escape quotes, \, /, \r, \n, \b, \f, \t and other control characters (U+0000 through U+001F). * @param s - Must not be null. * @param sb */