Skip to content
Snippets Groups Projects
Commit a5a1c30b authored by Lloyd Hilaiel's avatar Lloyd Hilaiel
Browse files

don't reference external resources from browserid.org to not piss off SSL, and...

don't reference external resources from browserid.org to not piss off SSL, and also a small pile of fixes to the testing harness -- specifically its handling of binary data, etc.
parent 7593b218
No related branches found
No related tags found
No related merge requests found
File added
@font-face {
font-family: 'Shadows Into Light';
font-style: normal;
font-weight: normal;
src: local('Shadows Into Light'), local('ShadowsIntoLight'), url('sil.ttf') format('truetype');
}
@font-face {
font-family: 'Tenor Sans';
font-style: normal;
font-weight: normal;
src: local('Tenor Sans'), local('TenorSans'), url('ts.ttf') format('truetype');
}
body {
padding: 0;
margin: 0;
......
File added
......@@ -3,8 +3,6 @@
<head>
<meta http-equiv="Content-type" content="text/html; charset=utf-8">
<title>BrowserID: A better way to log in.</title>
<link href='http://fonts.googleapis.com/css?family=Tenor+Sans' rel='stylesheet' type='text/css'>
<link href='http://fonts.googleapis.com/css?family=Shadows+Into+Light' rel='stylesheet' type='text/css'>
<link rel="stylesheet" href="css/style.css" type="text/css">
</head>
<body>
......
......@@ -18,7 +18,7 @@ function subHostNames(data) {
var a = o.server.address();
var from = o.name;
var to = "http://" + a.address + ":" + a.port;
data = data.replace(new RegExp(from, 'g'), to);
data = data.toString().replace(new RegExp(from, 'g'), to);
// now do another replacement to catch bare hostnames sans http(s)
// and explicit cases where port is appended
......@@ -51,20 +51,23 @@ function createServer(obj) {
var realWrite = resp.write;
var realEnd = resp.end;
var buf = "";
var buf = undefined;
var enc = undefined;
resp.write = function (chunk, encoding) {
buf += chunk;
if (buf) buf += chunk;
else buf = chunk;
enc = encoding;
};
resp.end = function() {
buf = subHostNames(buf);
try { resp.setHeader('Content-Length', buf.length); } catch(e) { console.log("OOOH: ", e) }
if (buf.length) {
realWrite.call(resp, buf, enc);
var ct = resp.getHeader('content-type');
if (ct && (ct === "application/javascript" || ct.substr(4) === 'text')) {
var l = buf.length;
buf = subHostNames(buf);
if (l != buf.length) resp.setHeader('Content-Length', buf.length);
}
if (buf && buf.length) realWrite.call(resp, buf, enc ? enc : "binary");
realEnd.call(resp);
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment