diff src/luan/modules/http/LuanHandler.java @ 1383:a3d0d1c2ce89

add NotFound to luanhost
author Franklin Schmidt <fschmidt@gmail.com>
date Thu, 01 Aug 2019 16:49:47 -0600
parents 5c3702f60200
children 0dc9837c16be
line wrap: on
line diff
--- a/src/luan/modules/http/LuanHandler.java	Mon Jul 29 09:50:14 2019 -0600
+++ b/src/luan/modules/http/LuanHandler.java	Thu Aug 01 16:49:47 2019 -0600
@@ -88,15 +88,17 @@
 		return luan;
 	}
 */
+	static final String NOT_FOUND = "luan-not-found";
+
 	@Override public Response handle(Request request) {
 		if( isDisabled )
 			return null;
 		if( request.path.endsWith("/") )
 			return null;
-		return handle(request,false);
+		return handle( request, request.headers.containsKey(NOT_FOUND) );
 	}
 
-	Response handle(Request request,boolean notFound) {
+	private Response handle(Request request,boolean notFound) {
 		Thread thread = Thread.currentThread();
 		String oldName = thread.getName();
 		thread.setName(request.headers.get("host")+request.path);