From 105ecab472dc0a608ed73ee2fd18593d50ee4d4c Mon Sep 17 00:00:00 2001 From: Cory McWilliams Date: Thu, 14 Apr 2016 23:37:23 +0000 Subject: [PATCH] Go back to allowing automatic guest sessions by default. WebSockets actually make this work better. git-svn-id: https://www.unprompted.com/svn/projects/tildefriends/trunk@3204 ed5197a5-7fde-0310-b194-c3ffbd925b24 --- core/client.js | 5 ++--- core/httpd.js | 4 ++-- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/core/client.js b/core/client.js index 1e05ba48..27bd57c4 100644 --- a/core/client.js +++ b/core/client.js @@ -288,10 +288,9 @@ function updateLogin() { } else { a.setAttribute("href", "/login/logout?return=" + encodeURIComponent(url() + hash())); } - } else if (window.location.href.indexOf("?guest=1") != -1) { - window.location.href = "/login?submit=Proceed+as+Guest&return=" + encodeURIComponent(url() + hash()); } else { - window.location.href = "/login?return=" + encodeURIComponent(url() + hash()); + a.appendChild(document.createTextNode("login")); + a.setAttribute("href", "/login?return=" + encodeURIComponent(url() + hash())); } login.appendChild(a); } diff --git a/core/httpd.js b/core/httpd.js index 9d13c3f4..7fc1cc7f 100644 --- a/core/httpd.js +++ b/core/httpd.js @@ -332,9 +332,9 @@ function handleConnection(client) { } function finish() { + var requestObject = new Request(request[0], request[1], request[2], headers, body, client); + var response = new Response(requestObject, client); try { - var requestObject = new Request(request[0], request[1], request[2], headers, body, client); - var response = new Response(requestObject, client); handleRequest(requestObject, response) if (client.isConnected) { reset();