summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorJoel Martin <github@martintribe.org>2010-11-07 22:28:08 -0600
committerJoel Martin <github@martintribe.org>2010-11-07 22:28:08 -0600
commit1ee2d93e94e631c3993c4fa1012af47378a53b5e (patch)
treed4bfd0c31f19c89d53178dd77cdb68c115482f6f /tests
parentfd758dd3357355399a573a3e3d9520dc838705b6 (diff)
downloadwebsockify-1ee2d93e94e631c3993c4fa1012af47378a53b5e.tar.gz
wsproxy.js: Fix multi-frame decoding.
- Also, discovered node.js bug in base64 decoding. Added test case and filed https://github.com/ry/node/issues/issue/402
Diffstat (limited to 'tests')
-rw-r--r--tests/base64.js12
1 files changed, 12 insertions, 0 deletions
diff --git a/tests/base64.js b/tests/base64.js
new file mode 100644
index 0000000..6ade00a
--- /dev/null
+++ b/tests/base64.js
@@ -0,0 +1,12 @@
+// The following results in 'hello [MANGLED]'
+//
+// Filed as https://github.com/ry/node/issues/issue/402
+
+var sys = require("sys"),
+ buf = new Buffer(1024), len,
+ str1 = "aGVsbG8g", // 'hello '
+ str2 = "d29ybGQ=", // 'world'
+
+len = buf.write(str1, 0, 'base64');
+len += buf.write(str2, len, 'base64');
+sys.log("decoded result: " + buf.toString('binary', 0, len));