@@ -22,13 +22,13 @@ status_t set_response_content(status_t ret, char** json_result) {
22
22
23
23
cJSON* json_obj = cJSON_CreateObject ();
24
24
if ((ret & SC_ERROR_MASK) == 0x03 ) {
25
- http_ret = SC_NOT_FOUND ;
25
+ http_ret = SC_HTTP_NOT_FOUND ;
26
26
cJSON_AddStringToObject (json_obj, " message" , " Request not found" );
27
27
} else if ((ret & SC_ERROR_MASK) == 0x07 ) {
28
- http_ret = SC_BAD_REQUEST ;
28
+ http_ret = SC_HTTP_BAD_REQUEST ;
29
29
cJSON_AddStringToObject (json_obj, " message" , " Invalid request header" );
30
30
} else {
31
- http_ret = SC_INTERNAL_SERVICE_ERROR ;
31
+ http_ret = SC_HTTP_INTERNAL_SERVICE_ERROR ;
32
32
cJSON_AddStringToObject (json_obj, " message" , " Internal service error" );
33
33
}
34
34
*json_result = cJSON_PrintUnformatted (json_obj);
@@ -231,7 +231,7 @@ int main(int, char const**) {
231
231
" Invalid request header" );
232
232
json_result = cJSON_PrintUnformatted (json_obj);
233
233
234
- res.set_status (SC_BAD_REQUEST );
234
+ res.set_status (SC_HTTP_BAD_REQUEST );
235
235
cJSON_Delete (json_obj);
236
236
} else {
237
237
ret = api_send_transfer (&service, req.body ().c_str (), &json_result);
@@ -260,7 +260,7 @@ int main(int, char const**) {
260
260
cJSON_AddStringToObject (json_obj, " message" , " Invalid path" );
261
261
const char * json = cJSON_PrintUnformatted (json_obj);
262
262
263
- res.set_status (SC_BAD_REQUEST );
263
+ res.set_status (SC_HTTP_BAD_REQUEST );
264
264
res.set_header (" Content-Type" , " application/json" );
265
265
res.set_header (" Access-Control-Allow-Origin" , " *" );
266
266
res << json;
0 commit comments