*** empty log message ***
authorMatthew Mondor <mmondor@pulsar-zone.net>
Sat, 9 Jul 2005 07:41:53 +0000 (07:41 +0000)
committerMatthew Mondor <mmondor@pulsar-zone.net>
Sat, 9 Jul 2005 07:41:53 +0000 (07:41 +0000)
tests/js-test/js/httpd/httpd.js

index 5238e05..b9733ad 100644 (file)
@@ -1,4 +1,4 @@
-/* $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.
  */
 
 
@@ -104,7 +98,7 @@ eval(file_read('root.js'));          /* Root object for virtual chroot(2) */
  * 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 $';
 
 
 
@@ -342,37 +336,16 @@ function http_error(fd, code, desc, ldesc)
            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;
 }
 
@@ -1150,7 +1123,7 @@ FD.prototype.httpDebug = function()
        tr.addContent(td);
        table.addContent(tr);
 
-       return table;
+       return table.toStr(0);
 }
 
 /*