diff src/luan/modules/http/impl/LuanHandler.java @ 1167:7e6f28c769a1

better handlers
author Franklin Schmidt <fschmidt@gmail.com>
date Thu, 08 Feb 2018 19:06:31 -0700
parents 6baccd0c85a7
children 3a0f58d09ee7
line wrap: on
line diff
--- a/src/luan/modules/http/impl/LuanHandler.java	Thu Feb 08 02:22:51 2018 -0700
+++ b/src/luan/modules/http/impl/LuanHandler.java	Thu Feb 08 19:06:31 2018 -0700
@@ -57,12 +57,19 @@
 	}
 
 	@Override public Response handle(Request request) {
+		if( request.path.endsWith("/") )
+			return null;
+		String modName = "site:" + request.path +".luan";
+		return handle(request,modName);
+	}
+
+	Response handle(Request request,String modName) {
 		Thread thread = Thread.currentThread();
 		String oldName = thread.getName();
 		thread.setName(request.headers.get("host")+request.path);
 		lock.readLock().lock();
 		try {
-			Response response = HttpServicer.service(luan,request);
+			Response response = HttpServicer.service(luan,request,modName);
 			return response;
 		} catch(LuanException e) {
 //e.printStackTrace();