server: fix query params lost when proxying requests in multi-model router mode (#19854)
* server: fix query params lost when proxying requests in multi-model router mode * server: re-encode query params using httplib::encode_query_component in proxy
This commit is contained in:
@@ -697,11 +697,15 @@ server_http_res_ptr server_models::proxy_request(const server_http_req & req, co
|
||||
mapping[name].meta.last_used = ggml_time_ms();
|
||||
}
|
||||
SRV_INF("proxying request to model %s on port %d\n", name.c_str(), meta->port);
|
||||
std::string proxy_path = req.path;
|
||||
if (!req.query_string.empty()) {
|
||||
proxy_path += '?' + req.query_string;
|
||||
}
|
||||
auto proxy = std::make_unique<server_http_proxy>(
|
||||
method,
|
||||
CHILD_ADDR,
|
||||
meta->port,
|
||||
req.path,
|
||||
proxy_path,
|
||||
req.headers,
|
||||
req.body,
|
||||
req.should_stop,
|
||||
|
||||
Reference in New Issue
Block a user