X-Git-Url: http://git.purplebirdman.com/public.git/blobdiff_plain/2a271915a66c003e4dba27ff7caa4fc19fb6dd29..7b1f2bbb5ccf914b9d239fd034a4180041047b45:/lua/publish.lua
diff --git a/lua/publish.lua b/lua/publish.lua
index b98e8f4..c0a4ff7 100644
--- a/lua/publish.lua
+++ b/lua/publish.lua
@@ -25,14 +25,19 @@ function handle(r)
if pattern then
local nonce = publish(r.context_document_root, pattern)
-
- -- if FQDN override is set,
- -- use override instead of my own server name and port number
- local fqdn = os.getenv('PUBLIC_FQDN_OVERRIDE')
- fqdn = fqdn or (r.is_https and "https" or "http") .. "://" .. r.server_name .. ":" ..r.port
-
- local uri = ("%s/%s/"):format(fqdn, nonce)
- r:puts( ([[%s]]):format(uri, uri) )
+ if nonce == "" then
+ r:puts( "No links created" )
+ else
+ -- if FQDN override is set,
+ -- use override instead of my own server name and port number
+ local fqdn = os.getenv('PUBLIC_FQDN_OVERRIDE')
+ fqdn = fqdn or
+ (r.is_https and "https" or "http") ..
+ "://" .. r.server_name .. ":" ..r.port
+
+ local uri = ("%s/%s/"):format(fqdn, nonce)
+ r:puts( ([[%s]]):format(uri, uri) )
+ end
else
local template = get_form(r.context_document_root)
r:puts( template )