-/* $Id: httpd.js,v 1.37 2005/07/09 07:27:25 mmondor Exp $ */
+/* $Id: httpd.js,v 1.38 2005/07/09 07:41:53 mmondor Exp $ */
/*
* Copyright (c) 2005, Matthew Mondor
* I'm not sure HTTP protocol is well suited to this type of limiting,
* some testing will be required.
* - Provide a function to scripts to redirect to another page.
- * - Maybe provide automatic cookie retry page.
- * This could be done by displaying a page with an auto-reload meta-tag
- * when no cookie was received from the client. The client would reload
- * the page, and if sending a cookie, wouldn't get this page again.
- * On failure to return the session cookie, a loop would ensue reloading
- * that page.
*/
* Server identification
*/
SERVER_VERSION = 'mmondor_js_httpd/0.0.1 (NetBSD)';
-SERVER_CVSID = '$Id: httpd.js,v 1.37 2005/07/09 07:27:25 mmondor Exp $';
+SERVER_CVSID = '$Id: httpd.js,v 1.38 2005/07/09 07:41:53 mmondor Exp $';
options.default_charset);
res.addNoCacheHeaders();
- var html = new MLTag('html', true);
- var head = new MLTag('head', true);
- var title = new MLTag('title', true);
- title.addContent(code + ' ' + desc);
- head.addContent(title);
+ res.addContent('<html><head><title>' + code + ' ' + desc +
+ '</title></head><body><h1>' + code + ' ' + desc + '</h1>' +
+ '<p>' + ldesc + '</p><br>');
- var body = new MLTag('body', true);
+ res.addContent(fd.httpDebug());
- var h1 = new MLTag('h1', true);
- h1.addContent(code + ' ' + desc);
- body.addContent(h1);
-
- var p = new MLTag('p', true);
- p.addContent(ldesc);
- body.addContent(p);
-
- body.addContent(fd.httpDebug());
- body.addContent('<br>');
-
- sub = new MLTag('sub', true);
- sub.addContent(SERVER_VERSION + '<br>' + SERVER_CVSID);
- body.addContent(sub);
-
- html.addContent(head);
- html.addContent(body);
-
- res.addContent(html.toStr(0) + "\n");
+ res.addContent('<br><sub>' + SERVER_VERSION + '<br>' + SERVER_CVSID +
+ '</sub></body></html>');
res.flush(fd, null);
-
- delete html;
delete res;
}
tr.addContent(td);
table.addContent(tr);
- return table;
+ return table.toStr(0);
}
/*