Mercurial Hosting > luan
diff src/luan/host/https.luan @ 1716:b82767112d8e
add String.regex
author | Franklin Schmidt <fschmidt@gmail.com> |
---|---|
date | Sun, 24 Jul 2022 23:43:03 -0600 |
parents | 570f3d483a31 |
children | f8eba0442956 |
line wrap: on
line diff
--- a/src/luan/host/https.luan Sat Jul 23 21:53:04 2022 -0600 +++ b/src/luan/host/https.luan Sun Jul 24 23:43:03 2022 -0600 @@ -8,8 +8,7 @@ local uri = Io.uri or error() local output_of = Io.output_of or error() local String = require "luan:String.luan" -local regex_quote = String.regex_quote or error() -local matches = String.matches or error() +local starts_with = String.starts_with or error() local Http = require "luan:http/Http.luan" local Hosted = require "luan:host/Hosted.luan" local Logging = require "luan:logging/Logging.luan" @@ -148,9 +147,9 @@ nginx_file.delete() local_cer_file.delete() local_ca_file.delete() - local ptn = [[^]]..regex_quote(domain)..[[\.]] + local ptn = domain.."." for _, file in ipairs(dir.children()) do - if matches(file.name(),ptn) then + if starts_with(file.name(),ptn) then file.delete() end end