Allow only POST to post

This commit is contained in:
thematdev 2023-07-06 17:10:22 +03:00
parent 27109f25ac
commit 8822fb6f20
Signed by: thematdev
GPG Key ID: D12878639B090D90
2 changed files with 4 additions and 2 deletions

View File

@ -67,7 +67,8 @@ int
cgiMain()
{
char *message;
if (cgiFormSubmitClicked("login") == cgiFormSuccess) {
if (cgiFormSubmitClicked("login") == cgiFormSuccess &&
!strcmp(cgiRequestMethod, "POST")) {
message = validate_credentials();
} else {
message = "";

View File

@ -238,7 +238,8 @@ cgiMain()
fprintf(cgiOut, "<body>\n");
if (cgiFormSubmitClicked("submit") == cgiFormSuccess) {
if (cgiFormSubmitClicked("submit") == cgiFormSuccess &&
!strcmp(cgiRequestMethod, "POST")) {
handle_submitted_comment();
}