1
0
Fork 0
mirror of https://github.com/ossrs/srs.git synced 2025-03-09 15:49:59 +00:00

Set empty HTTP paths to '/' to avoid malformed requests (#2329)

This resolves #1610.
This commit is contained in:
Justin Kromlinger 2021-09-07 02:15:27 +02:00 committed by GitHub
parent fef474d503
commit 8aee0169ce
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -322,6 +322,10 @@ srs_error_t SrsHttpClient::post(string path, string req, ISrsHttpMessage** ppmsg
return srs_error_wrap(err, "http: connect server");
}
if (path.size() == 0) {
path = "/";
}
// send POST request to uri
// POST %s HTTP/1.1\r\nHost: %s\r\nContent-Length: %d\r\n\r\n%s
std::stringstream ss;