fix json indent

This commit is contained in:
blueloveTH 2025-04-05 14:52:38 +08:00
parent 1f8212dadf
commit e4130ad12e
2 changed files with 2 additions and 2 deletions

View File

@ -217,7 +217,7 @@ static bool libhv_HttpClient__send_request(py_Ref arg_self,
return ValueError("HttpClient: data and json cannot be set at the same time");
}
if(!py_json_dumps(arg_json)) return false;
if(!py_json_dumps(arg_json, 0)) return false;
req->body = py_tostr(py_retval());
req->headers["Content-Type"] = "application/json";
}

View File

@ -136,7 +136,7 @@ static bool libhv_HttpServer_dispatch(int argc, py_Ref argv) {
break;
}
default: {
if(!py_json_dumps(object)) return false;
if(!py_json_dumps(object, 0)) return false;
c11_sv sv = py_tosv(py_retval());
ctx->response->String(std::string(sv.data, sv.size));
ctx->response->SetContentType(APPLICATION_JSON);