Browse Source

fix json indent

blueloveTH 11 months ago
parent
commit
e4130ad12e
2 changed files with 2 additions and 2 deletions
  1. 1 1
      3rd/libhv/src/HttpClient.cpp
  2. 1 1
      3rd/libhv/src/HttpServer.cpp

+ 1 - 1
3rd/libhv/src/HttpClient.cpp

@@ -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";
     }

+ 1 - 1
3rd/libhv/src/HttpServer.cpp

@@ -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);