Add asynchronous page content request

This commit is contained in:
josh committed 2026-04-01 13:06:06 -04:00
1 parent ed4e749901
commit 244edf90ac
2 files changed
+26

No files matched your search

+13
View File
@@ -79,6 +79,19 @@ if cgi.request_method == "POST" && !authenticated
end
end
if cgi.params.key?("content")
if authenticated
cgi.out("type" => "text/html", "charset" => "UTF-8") do
"<p>Content placeholder</p>"
end
else
cgi.out("Status" => "403 Forbidden", "type" => "text/plain", "charset" => "UTF-8") do
"Forbidden"
end
end
exit
end
template = ERB.new(File.read(File.join(ASSETS_DIR, "page.erb")))
out_params = { "type" => "text/html", "charset" => "UTF-8" }