Added primitive support for basic authentication

Note that the password will be passed over HTTP in plain text.
This commit is contained in:
Jermolene
2013-11-28 14:03:08 +00:00
parent c0a6e94b21
commit 7d12d89a0a
8 changed files with 68 additions and 18 deletions
+12
View File
@@ -413,4 +413,16 @@ exports.hashString = function(str) {
},0);
};
/*
Decode a base64 string
*/
exports.base64Decode = function(string64) {
if($tw.browser) {
// TODO
throw "$tw.utils.base64Decode() doesn't work in the browser";
} else {
return (new Buffer(string64,"base64")).toString();
}
};
})();