fix(libhttp,dnfs2): HttpClient 新增超时接口,dnfs2 启用配置超时
修复 dnfs2 审计 L-3(P2-N5): libhttp HttpClient 硬编码 CURLOPT_TIMEOUT=30L/CONNECTTIMEOUT=10L, dnfs2 的 gateway_timeout/review_timeout 配置加载后从未使用,实际超时恒为 30s。 修复: - libhttp HttpClient 新增 set_timeout/set_connect_timeout 接口 (默认 30s/10s,向后兼容 gateway/core) - request_stream_sync 使用成员变量替代硬编码值 - dnfs2 decode_token 设置 gateway_timeout - dnfs2 review_content 设置 review_timeout 安全评级 A- → A,已知限制 6→5 项。
This commit is contained in:
1 parent
9804838e96
commit
117fc0241e
5 files changed
+70
-16
No files matched your search
@@ -643,6 +643,7 @@ private:
|
||||
|
||||
HttpClient http;
|
||||
http.set_max_response_size(kHttpMaxResponse);
|
||||
http.set_timeout(static_cast<long>(_cfg.gateway_timeout));
|
||||
http.set_header("Content-Type: application/json");
|
||||
http.set_header("Authorization: Bearer " + token);
|
||||
|
||||
@@ -704,6 +705,7 @@ private:
|
||||
bool review_content(const std::string& content) {
|
||||
HttpClient http;
|
||||
http.set_max_response_size(kHttpMaxResponse);
|
||||
http.set_timeout(static_cast<long>(_cfg.review_timeout));
|
||||
http.set_header("Content-Type: application/json");
|
||||
|
||||
json::object payload;
|
||||
|
||||
Reference in new issue
Block a user