summaryrefslogtreecommitdiff
path: root/scripts/context/lua/mtx-server.lua
diff options
context:
space:
mode:
authorMarius <mariausol@gmail.com>2013-09-20 15:00:28 +0300
committerMarius <mariausol@gmail.com>2013-09-20 15:00:28 +0300
commitdf1ef72f7d17b4d6a0368ba1290e083b08280cc5 (patch)
treed78b63f738350b59fa7b0b792f6eccf19a8dd5e0 /scripts/context/lua/mtx-server.lua
parent5be028e9e8cad8e72967191716ba3974bb7832db (diff)
downloadcontext-df1ef72f7d17b4d6a0368ba1290e083b08280cc5.tar.gz
beta 2013.09.20 14:01
Diffstat (limited to 'scripts/context/lua/mtx-server.lua')
-rw-r--r--scripts/context/lua/mtx-server.lua6
1 files changed, 4 insertions, 2 deletions
diff --git a/scripts/context/lua/mtx-server.lua b/scripts/context/lua/mtx-server.lua
index 5ec15de70..5466bfe80 100644
--- a/scripts/context/lua/mtx-server.lua
+++ b/scripts/context/lua/mtx-server.lua
@@ -43,7 +43,7 @@ scripts.webserver = scripts.webserver or { }
dofile(resolvers.findfile("luat-soc.lua","tex"))
local socket = socket or require("socket")
-local http = http or require("socket.http") -- not needed
+----- http = http or require("socket.http") -- not needed
local format = string.format
-- The following two lists are taken from webrick (ruby) and
@@ -197,6 +197,7 @@ function handlers.generic(client,configuration,data,suffix,iscontent)
client:send("Connection: close\r\n")
client:send(format("Content-Length: %s\r\n",#data))
client:send(format("Content-Type: %s\r\n",(suffix and mimetypes[suffix]) or "text/html"))
+ client:send("Cache-Control: no-cache, no-store, must-revalidate, max-age=0\r\n")
client:send("\r\n")
client:send(data)
client:send("\r\n")
@@ -333,8 +334,9 @@ function scripts.webserver.run(configuration)
report("no url")
errormessage(client,configuration,404)
else
+ fullurl = url.unescapeget(fullurl)
report("requested url: %s",fullurl)
- fullurl = socket.url.unescape(fullurl) -- still needed?
+ -- fullurl = socket.url.unescape(fullurl) -- happens later
local hashed = url.hashed(fullurl)
local query = url.query(hashed.query)
local filename = hashed.path -- hm, not query?