summaryrefslogtreecommitdiff
path: root/share
diff options
context:
space:
mode:
Diffstat (limited to 'share')
-rw-r--r--share/www/script/test/cookie_auth.js4
-rw-r--r--share/www/script/test/oauth.js3
2 files changed, 5 insertions, 2 deletions
diff --git a/share/www/script/test/cookie_auth.js b/share/www/script/test/cookie_auth.js
index d029e851..d82d302a 100644
--- a/share/www/script/test/cookie_auth.js
+++ b/share/www/script/test/cookie_auth.js
@@ -20,12 +20,14 @@ couchTests.cookie_auth = function(debug) {
// Simple secret key generator
function generateSecret(length) {
+ var tab = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
var secret = '';
for (var i=0; i<length; i++) {
- secret += String.fromCharCode(Math.floor(Math.random() * 256));
+ secret += tab.charAt(Math.floor(Math.random() * 64));
}
return secret;
}
+
// this function will be called on the modified server
var testFun = function () {
try {
diff --git a/share/www/script/test/oauth.js b/share/www/script/test/oauth.js
index 8b71d745..ebe817b2 100644
--- a/share/www/script/test/oauth.js
+++ b/share/www/script/test/oauth.js
@@ -29,9 +29,10 @@ couchTests.oauth = function(debug) {
// Simple secret key generator
function generateSecret(length) {
+ var tab = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
var secret = '';
for (var i=0; i<length; i++) {
- secret += String.fromCharCode(Math.floor(Math.random() * 256));
+ secret += tab.charAt(Math.floor(Math.random() * 64));
}
return secret;
}