Set empty HTTP paths to '/' to avoid malformed requests (#2329)
This resolves #1610.
This commit is contained in:
parent
fef474d503
commit
8aee0169ce
|
|
@ -322,6 +322,10 @@ srs_error_t SrsHttpClient::post(string path, string req, ISrsHttpMessage** ppmsg
|
||||||
return srs_error_wrap(err, "http: connect server");
|
return srs_error_wrap(err, "http: connect server");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (path.size() == 0) {
|
||||||
|
path = "/";
|
||||||
|
}
|
||||||
|
|
||||||
// send POST request to uri
|
// send POST request to uri
|
||||||
// POST %s HTTP/1.1\r\nHost: %s\r\nContent-Length: %d\r\n\r\n%s
|
// POST %s HTTP/1.1\r\nHost: %s\r\nContent-Length: %d\r\n\r\n%s
|
||||||
std::stringstream ss;
|
std::stringstream ss;
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user