echo: make quit into a button, to perform the POST action properly

This commit is contained in:
Simon Cruanes 2022-03-29 22:54:37 -04:00
parent 16b306c19a
commit 353cee7a5d
No known key found for this signature in database
GPG key ID: EBFFF6F283F3A2B4

View file

@ -178,8 +178,19 @@ let () =
li[][pre[][txt "/zcat/:path (GET) to download a file (deflate transfer-encoding)"]]; li[][pre[][txt "/zcat/:path (GET) to download a file (deflate transfer-encoding)"]];
li[][pre[][a[A.href "/stats/"][txt"/stats/"]; txt" (GET) to access statistics"]]; li[][pre[][a[A.href "/stats/"][txt"/stats/"]; txt" (GET) to access statistics"]];
li[][pre[][a[A.href "/vfs/"][txt"/vfs"]; txt" (GET) to access a VFS embedded in the binary"]]; li[][pre[][a[A.href "/vfs/"][txt"/vfs"]; txt" (GET) to access a VFS embedded in the binary"]];
li[][pre[][a[A.href "/quit"][txt "/quit"]; txt" (POST) to quit"]]; li[][
li[][pre[][a[A.href "/protected"][txt "/protected"]; txt" (GET) to see a protected page (user:foobar)"]]; pre[A.style "display: inline"][
a[A.href "/quit"][txt "/quit"]; txt" (POST) to stop server"
];
form[A.style "display: inline";
A.action "/quit"; A.method_ "POST";
][
button
[A.type_ "submit"]
[txt"quit"]
];
];
li[][pre[][a[A.href "/protected"][txt "/protected"]; txt" (GET) to see a protected page (login: user, password: foobar)"]];
li[][pre[][a[A.href "/logout"][txt "/logout"]; txt" (POST) to log out"]]; li[][pre[][a[A.href "/logout"][txt "/logout"]; txt" (POST) to log out"]];
] ]
] ]