mirror of
https://github.com/jart/cosmopolitan.git
synced 2025-08-09 03:10:27 +00:00
Update deprecated APIs in demo code
This commit is contained in:
parent
c8c2167609
commit
2a96bd554a
3 changed files with 7 additions and 7 deletions
|
@ -6,7 +6,7 @@ local function main()
|
||||||
end
|
end
|
||||||
SetStatus(200)
|
SetStatus(200)
|
||||||
SetHeader("Content-Type", GetHeader("Content-Type") or "text/plain")
|
SetHeader("Content-Type", GetHeader("Content-Type") or "text/plain")
|
||||||
Write(GetPayload())
|
Write(GetBody())
|
||||||
end
|
end
|
||||||
|
|
||||||
main()
|
main()
|
||||||
|
|
|
@ -57,7 +57,7 @@ local function main()
|
||||||
|
|
||||||
Write('<dt>Payload\r\n')
|
Write('<dt>Payload\r\n')
|
||||||
Write('<dd><p>')
|
Write('<dd><p>')
|
||||||
Write(EscapeHtml(VisualizeControlCodes(GetPayload())))
|
Write(EscapeHtml(VisualizeControlCodes(GetBody())))
|
||||||
Write('\r\n')
|
Write('\r\n')
|
||||||
|
|
||||||
Write('</dl>\r\n')
|
Write('</dl>\r\n')
|
||||||
|
|
|
@ -72,11 +72,11 @@ local function main()
|
||||||
-- redbean command line arguments
|
-- redbean command line arguments
|
||||||
-- these come *after* the c getopt server arguments
|
-- these come *after* the c getopt server arguments
|
||||||
Write('<h3>command line arguments</h3>\r\n')
|
Write('<h3>command line arguments</h3>\r\n')
|
||||||
if #argv > 0 then
|
if #arg > 0 then
|
||||||
Write('<ul>\r\n')
|
Write('<ul>\r\n')
|
||||||
for i = 1,#argv do
|
for i = 1,#arg do
|
||||||
Write('<li>')
|
Write('<li>')
|
||||||
Write(EscapeHtml(VisualizeControlCodes(argv[i])))
|
Write(EscapeHtml(VisualizeControlCodes(arg[i])))
|
||||||
Write('\r\n')
|
Write('\r\n')
|
||||||
end
|
end
|
||||||
Write('</ul>\r\n')
|
Write('</ul>\r\n')
|
||||||
|
@ -333,9 +333,9 @@ local function main()
|
||||||
Write('Size: ')
|
Write('Size: ')
|
||||||
Write(tostring(GetAssetSize(paths[i])))
|
Write(tostring(GetAssetSize(paths[i])))
|
||||||
Write('<br>\r\n')
|
Write('<br>\r\n')
|
||||||
if GetComment(paths[i]) then
|
if GetAssetComment(paths[i]) then
|
||||||
Write('Comment: ')
|
Write('Comment: ')
|
||||||
Write(EscapeHtml(VisualizeControlCodes(GetComment(paths[i]))))
|
Write(EscapeHtml(VisualizeControlCodes(GetAssetComment(paths[i]))))
|
||||||
Write('<br>\r\n')
|
Write('<br>\r\n')
|
||||||
end
|
end
|
||||||
Write('\r\n')
|
Write('\r\n')
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue