summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorAki <please@ignore.pl>2021-03-04 00:18:40 +0100
committerAki <please@ignore.pl>2021-03-04 00:18:40 +0100
commiteb8aab2bb5906fe26a881b526da5696e49abddc5 (patch)
tree7c584a126b7ffd231c6e2a7112ce7cf4b7c62e9b
parent0bcf8ce0abc99c58de57257adb129db28f49d768 (diff)
downloadplop-eb8aab2bb5906fe26a881b526da5696e49abddc5.zip
plop-eb8aab2bb5906fe26a881b526da5696e49abddc5.tar.gz
plop-eb8aab2bb5906fe26a881b526da5696e49abddc5.tar.bz2
Reformatted default response
-rw-r--r--default.lua10
1 files changed, 7 insertions, 3 deletions
diff --git a/default.lua b/default.lua
index 1de910e..7100927 100644
--- a/default.lua
+++ b/default.lua
@@ -2,7 +2,11 @@ local RESPONSE = [[<!doctype html>
<html lang="en">
<title>plop</title>
<h1>Hello, from plop/lua!</h1>
-<p>You requested <code>%s</code> using <b>%s</b> with %s and:
+<table>
+<tr><th>Method<th>Path<th>Version
+<tr><td>%s<td>%s<td>%s
+</table>
+<hr>
<table>
<tr><th>Header<th>Value
%s</table>
@@ -25,9 +29,9 @@ return function (stream)
end
local headers_table = ""
for header, value in pairs(headers) do
- headers_table = HEADER:format(headers_table_body, header, value)
+ headers_table = HEADER:format(headers_table, header, value)
end
- local response = RESPONSE:format(path, method, version, headers_table_body)
+ local response = RESPONSE:format(method, path, version, headers_table)
local headers = {Connection="close", ["Content-Length"]=#response, ["Content-Type"]="text/html"}
return {status=status, headers=headers, data=response}
end