updated format
Prepare Build and Testing executable binary / Prepare-Build-Testing-With-Make (push) Successful in 10s
Prepare Build and Testing executable binary / Prepare-Build-Testing-With-CMake (push) Successful in 12s
Prepare Build and Testing executable binary / Prepare-Build-Testing-With-Meson (push) Successful in 12s

This commit is contained in:
wt committed 2025-09-02 14:39:23 +07:00
1 parent d6409140f1
commit 6c556624bd
23 files changed
+147 -113

No files matched your search

+5 -3
View File
@@ -1,11 +1,13 @@
#include "utils.h"
#include <cJSON.h>
#include <mongoose.h>
#include "user.h"
request_with_token *check_body(const struct mg_http_message *hm) {
if (hm->body.len == 0) {
return new_request_with_token(nullptr, nullptr, (char *) "must have token");
return new_request_with_token(nullptr, nullptr, (char *)"must have token");
}
cJSON *json_body = cJSON_Parse(hm->body.buf);
@@ -13,9 +15,9 @@ request_with_token *check_body(const struct mg_http_message *hm) {
if (token == NULL) {
const char *error_ptr = cJSON_GetErrorPtr();
if (error_ptr != NULL) {
return new_request_with_token(nullptr, nullptr, (char *) error_ptr);
return new_request_with_token(nullptr, nullptr, (char *)error_ptr);
}
return new_request_with_token(nullptr, nullptr, (char *) "must have token");
return new_request_with_token(nullptr, nullptr, (char *)"must have token");
}
return new_request_with_token(strdup(token->valuestring), json_body, nullptr);
}