From 5f07270c7f518a3b489f4bf682983a35426bbe35 Mon Sep 17 00:00:00 2001 From: Reuh Date: Sat, 17 Dec 2016 18:48:13 +0100 Subject: [PATCH] Oops --- vrel.lua | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/vrel.lua b/vrel.lua index 2e800f8..aba99f5 100644 --- a/vrel.lua +++ b/vrel.lua @@ -242,10 +242,10 @@ httpd.start(config.address or "*", config.port or 8155, { -- Pages ([[%s - vrel%s]]):format(name, highlight(paste, name:lower():match("%.([a-z]+)$"))) } end end, - ["/g/(.+)"] = function(request, name) local d = get(name, request) return d and { cache = math.min(d.expire - os.time(), config.cacheDuration or 3600), "200 OK", {["Content-Type"] = "text; charset=utf-8"}, d.data } or nil end, + ["/g/(.+)"] = function(request, name) local d = get(name, request) return d and { cache = math.min(d.expire - os.time(), config.cacheDuration or 3600), "200 OK", {["Content-Type"] = "text/plain; charset=utf-8"}, d.data } or nil end, ["/p"] = function(request) if request.method == "POST" and request.post.data then - local name, paste = post({ lifetime = (tonumber(request.post.lifetime) or defaultLifetime)*(request.post.web and 1 or 1), burnOnRead = request.post.burnOnRead == "on", + local name, paste = post({ lifetime = (tonumber(request.post.lifetime) or defaultLifetime)*(request.post.web and 3600 or 1), burnOnRead = request.post.burnOnRead == "on", syntax = (request.post.web and request.post.syntax == "" and "text") or request.post.syntax, data = request.post.data }, request) return request.post.web and { "303 See Other", {["Location"] = "/"..name}, "" } or { "200 OK", {["Content-Type"] = "text/json; charset=utf-8"}, ([[{"name":"%s","lifetime":%s,"burnOnRead":%s,"syntax":"%s"}]]):format(name, paste.expire-os.time(), paste.burnOnRead,paste.syntax) }