mirror of
https://github.com/ossrs/srs.git
synced 2025-03-09 15:49:59 +00:00
Refactor header of HTTP message by using SrsHttpHeader.
This commit is contained in:
parent
dcb7b6aae0
commit
ca2b68f428
6 changed files with 95 additions and 120 deletions
|
@ -664,12 +664,7 @@ srs_error_t SrsGoApiRequests::serve_http(ISrsHttpResponseWriter* w, ISrsHttpMess
|
|||
// request headers
|
||||
SrsJsonObject* headers = SrsJsonAny::object();
|
||||
data->set("headers", headers);
|
||||
|
||||
for (int i = 0; i < r->request_header_count(); i++) {
|
||||
std::string key = r->request_header_key_at(i);
|
||||
std::string value = r->request_header_value_at(i);
|
||||
headers->set(key, SrsJsonAny::str(value.c_str()));
|
||||
}
|
||||
r->header()->dumps(headers);
|
||||
|
||||
// server informations
|
||||
SrsJsonObject* server = SrsJsonAny::object();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue