Skip to content

Instantly share code, notes, and snippets.

@stenington
Created March 12, 2013 22:00
Show Gist options
  • Save stenington/b02bb44116a87a071c3f to your computer and use it in GitHub Desktop.
Save stenington/b02bb44116a87a071c3f to your computer and use it in GitHub Desktop.
Demonstrates decode failure on urls with subdomains
diff --git a/test/jws.test.js b/test/jws.test.js
index 28546d4..23941c4 100644
--- a/test/jws.test.js
+++ b/test/jws.test.js
@@ -207,7 +207,7 @@ test('Streaming verify: ECDSA, with invalid key', function (t) {
});
test('jws.decode: not a jws signature', function (t) {
- const result = jws.decode('some garbage string');
- t.same(result, false, 'should return false if it cannot decode');
+ t.same(jws.decode('some garbage string'), false, 'should return false if it cannot decode');
+ t.same(jws.decode('http://sub.domain.org'), false, 'should return false if it cannot decode');
t.end();
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment