Diff

net/httpserver_listener.lua @ 1540:19fb86c19a59

net.httpserver: Mark a request as secure if it is made using HTTPS
author Matthew Wild <mwild1@gmail.com>
date Sun, 12 Jul 2009 19:16:13 +0100
parent 1522:569d58d21612
child 2129:fcdcdf00787c
child 2923:b7049746bd29
line wrap: on
line diff
--- a/net/httpserver_listener.lua	Sun Jul 12 15:22:37 2009 +0100
+++ b/net/httpserver_listener.lua	Sun Jul 12 19:16:13 2009 +0100
@@ -22,6 +22,11 @@
 	if not request then
 		request = new_request(conn);
 		requests[conn] = request;
+		
+		-- If using HTTPS, request is secure
+		if conn.ssl() then
+			request.secure = true;
+		end
 	end
 
 	if data then