Thu, 15 Jan 2015 15:59:08 +0100
Implement a real Private Browsing Mode condition by changing the API/ABI;
This solves Tor bug #9701, complying with disk avoidance documented in
https://www.torproject.org/projects/torbrowser/design/#disk-avoidance.
1 function handleRequest(request, response)
2 {
3 var auth = "";
4 try {
5 auth = request.getHeader("Authorization");
6 } catch(e) {}
8 if (auth == "Basic aHR0cHVzZXI6aHR0cHBhc3M=") {
9 response.setStatusLine("1.1", 200, "OK");
10 response.write("<html><head><title>http auth success</title></head><html>");
11 } else {
12 response.setStatusLine("1.1", 401, "Http authentication required");
13 response.setHeader("WWW-Authenticate", "Basic realm=\"http_realm\"");
14 response.write("<html><head><title>http auth failed</title></head><html>");
15 }
16 }