forked from cory/tildefriends
Oh, the webroot mode works well enough for me to use Let's Encrypt for Tilde Friends.
git-svn-id: https://www.unprompted.com/svn/projects/tildefriends/trunk@3384 ed5197a5-7fde-0310-b194-c3ffbd925b24
This commit is contained in:
@ -445,6 +445,15 @@ httpd.all("", function(request, response) {
|
||||
return terminal.handler(request, response, match[1], match[2], match[3]);
|
||||
} else if (request.uri == "/robots.txt") {
|
||||
return terminal.handler(request, response, null, null, request.uri);
|
||||
} else if ((match = /^\/.well-known\/(.*)/.exec(request.uri)) && request.uri.indexOf("..") == -1) {
|
||||
var data = File.readFile("data/global/.well-known/" + match[1]);
|
||||
if (data) {
|
||||
response.writeHead(200, {"Content-Type": "text/plain", "Content-Length": data.length});
|
||||
response.end(data);
|
||||
} else {
|
||||
response.writeHead(404, {"Content-Type": "text/plain", "Content-Length": "File not found".length});
|
||||
response.end("File not found");
|
||||
}
|
||||
} else {
|
||||
var data = "File not found.";
|
||||
response.writeHead(404, {"Content-Type": "text/plain; charset=utf-8", "Content-Length": data.length.toString()});
|
||||
|
Reference in New Issue
Block a user