Mercurial Hosting > luan
changeset 1426:94a6a209d4e2
fix
author | Franklin Schmidt <fschmidt@gmail.com> |
---|---|
date | Sun, 24 Nov 2019 16:38:06 -0700 |
parents | b6030fa18839 |
children | a076e89a2879 |
files | src/luan/host/init.luan src/luan/modules/Boot.luan |
diffstat | 2 files changed, 6 insertions(+), 7 deletions(-) [+] |
line wrap: on
line diff
--- a/src/luan/host/init.luan Sun Nov 24 16:04:58 2019 -0700 +++ b/src/luan/host/init.luan Sun Nov 24 16:38:06 2019 -0700 @@ -50,7 +50,9 @@ Http.is_serving = true function Io.schemes.site(path,loading) - return Io.uri( Http.dir..path, loading ) + local u = Io.uri( Http.dir..path, loading ) + u.uri_string = "site:"..path + return u end Http.domain = domain
--- a/src/luan/modules/Boot.luan Sun Nov 24 16:04:58 2019 -0700 +++ b/src/luan/modules/Boot.luan Sun Nov 24 16:38:06 2019 -0700 @@ -52,11 +52,7 @@ this.checksum = io.checksum this.charset = io.charset this.set_charset = io.set_charset - - function this.to_uri_string() - return this.uri_string or io.to_uri_string() - end - + this.to_uri_string = io.to_uri_string return this end Boot.new_LuanIn = new_LuanIn @@ -252,7 +248,8 @@ return load(src,file) elseif type(file) == "table" and file.read_text ~= nil then local src = file.read_text() - return load(src,file.to_uri_string()) + local src_file = file.uri_string or file.to_uri_string() + return load(src,src_file) else error("bad argument, expected string or uri table but got "..type(file)) end