added corsheaders

This commit is contained in:
wt committed 2024-05-27 13:16:51 +07:00
1 parent 4079d3a6fa
commit ab5389857c
12 files changed
+37

No files matched your search

+1
View File
@@ -14,6 +14,7 @@ std::string get_random_string(const char *alphabet, int quantity) {
// function for add user
void add_user(const httplib::Request& request, httplib::Response& response) {
response.set_header("Access-Control-Allow-Origin", "*");
if (request.body == "") {response.set_content("{\"required\":\"[token,username,password]\",\"optional\":\"[group,is_superuser]\"}", "application/json");return;}
nlohmann::json json_body = nlohmann::json::parse(request.body);