Fix typo in HTTP headers. I need to refactor so header creation is single sourced. Oh well. This may fix issues in Firefox
This commit is contained in:
parent
871105dc64
commit
f7969ae12d
@ -1,5 +1,5 @@
|
|||||||
return function (connection, args)
|
return function (connection, args)
|
||||||
connection:send("HTTP/1.0 200 OK\r\nContent-Type: text/html\r\Cache-Control: private, no-store\r\n\r\n")
|
connection:send("HTTP/1.0 200 OK\r\nContent-Type: text/html\r\nCache-Control: private, no-store\r\n\r\n")
|
||||||
connection:send('<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><title>Arguments</title></head>')
|
connection:send('<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><title>Arguments</title></head>')
|
||||||
connection:send('<body>')
|
connection:send('<body>')
|
||||||
connection:send('<h1>Arguments</h1>')
|
connection:send('<h1>Arguments</h1>')
|
||||||
|
|||||||
@ -1,5 +1,5 @@
|
|||||||
return function (connection, args)
|
return function (connection, args)
|
||||||
connection:send("HTTP/1.0 200 OK\r\nContent-Type: text/html\r\Cache-Control: private, no-store\r\n\r\n")
|
connection:send("HTTP/1.0 200 OK\r\nContent-Type: text/html\r\nCache-Control: private, no-store\r\n\r\n")
|
||||||
connection:send('<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><title>Server File Listing</title></head>')
|
connection:send('<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><title>Server File Listing</title></head>')
|
||||||
connection:send('<body>')
|
connection:send('<body>')
|
||||||
connection:send('<h1>Server File Listing</h1>')
|
connection:send('<h1>Server File Listing</h1>')
|
||||||
|
|||||||
@ -16,7 +16,7 @@ local function pushTheButton(connection, pin)
|
|||||||
gpio.mode(pin, gpio.INPUT)
|
gpio.mode(pin, gpio.INPUT)
|
||||||
|
|
||||||
-- Send back JSON response.
|
-- Send back JSON response.
|
||||||
connection:send("HTTP/1.0 200 OK\r\nContent-Type: application/json\r\Cache-Control: private, no-store\r\n\r\n")
|
connection:send("HTTP/1.0 200 OK\r\nContent-Type: application/json\r\nCache-Control: private, no-store\r\n\r\n")
|
||||||
connection:send('{"error":0, "message":"OK"}')
|
connection:send('{"error":0, "message":"OK"}')
|
||||||
|
|
||||||
end
|
end
|
||||||
@ -26,7 +26,7 @@ return function (connection, args)
|
|||||||
if args.door == "1" then pushTheButton(connection, 3) -- GPIO0
|
if args.door == "1" then pushTheButton(connection, 3) -- GPIO0
|
||||||
elseif args.door == "2" then pushTheButton(connection, 4) -- GPIO2
|
elseif args.door == "2" then pushTheButton(connection, 4) -- GPIO2
|
||||||
else
|
else
|
||||||
connection:send("HTTP/1.0 400 OK\r\nContent-Type: application/json\r\Cache-Control: private, no-store\r\n\r\n")
|
connection:send("HTTP/1.0 400 OK\r\nContent-Type: application/json\r\nCache-Control: private, no-store\r\n\r\n")
|
||||||
connection:send('{"error":-1, "message":"Bad door"}')
|
connection:send('{"error":-1, "message":"Bad door"}')
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
@ -1,5 +1,5 @@
|
|||||||
local function sendHeader(connection)
|
local function sendHeader(connection)
|
||||||
connection:send("HTTP/1.0 200 OK\r\nContent-Type: text/html\r\Cache-Control: private, no-store\r\n\r\n")
|
connection:send("HTTP/1.0 200 OK\r\nContent-Type: text/html\rCache-Control: private, no-store\r\n\r\n")
|
||||||
end
|
end
|
||||||
|
|
||||||
local function sendAttr(connection, attr, val)
|
local function sendAttr(connection, attr, val)
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user