changeset 1359:9721d4709bfb

minor
author Franklin Schmidt <fschmidt@gmail.com>
date Fri, 19 Apr 2019 00:58:18 -0600
parents 1d31c1f3ea30
children ee0f0e6c89a0
files src/luan/modules/http/LuanHandler.java
diffstat 1 files changed, 7 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/src/luan/modules/http/LuanHandler.java	Fri Apr 19 00:47:58 2019 -0600
+++ b/src/luan/modules/http/LuanHandler.java	Fri Apr 19 00:58:18 2019 -0600
@@ -242,7 +242,7 @@
 		Luan luan;
 		synchronized(luanInit) {
 			enableLoad("luan:http/Http.luan",modName);
- 			PackageLuan.require(currentLuan,"luan:http/Http.luan");
+ 			currentLuan.require("luan:http/Http.luan");
 			Object mod = PackageLuan.load(currentLuan,modName);
 			if( mod.equals(Boolean.FALSE) )
 				return null;
@@ -262,17 +262,19 @@
 	private Response serviceNotFound(Request request)
 		throws LuanException
 	{
+		LuanFunction fn;
 		Luan luan;
 		synchronized(luanInit) {
 			enableLoad("luan:http/Http.luan");
- 			PackageLuan.require(currentLuan,"luan:http/Http.luan");
+ 			LuanTable module = (LuanTable)currentLuan.require("luan:http/Http.luan");
+			fn = module.fn("not_found_handler");
+			if( fn == null )
+				return null;
 			LuanCloner cloner = new LuanCloner(LuanCloner.Type.INCREMENTAL);
 			luan = (Luan)cloner.clone(currentLuan);
+			fn = (LuanFunction)cloner.get(fn);
 		}
 		LuanTable module = (LuanTable)luan.require("luan:http/Http.luan");
-		LuanFunction fn = module.fn("not_found_handler");
-		if( fn == null )
-			return null;
 		module.fn("new_request").call(request);
 		module.fn("new_response").call();
 		Object obj = Luan.first(fn.call());