Rename header to header_list

This commit is contained in:
King_DuckZ 2020-09-04 15:09:08 +01:00
parent f8fde74b84
commit a5e2c14171
3 changed files with 3 additions and 3 deletions

View file

@ -26,7 +26,7 @@ namespace nap {
struct HttpResponse {
std::unique_ptr<char[]> raw;
std::vector<std::pair<std::string_view, std::string_view>> header;
std::vector<std::pair<std::string_view, std::string_view>> header_list;
std::string_view body;
std::string_view http_ver;
std::string_view code_desc;

View file

@ -110,7 +110,7 @@ HttpResponse page_fetch (
}
auto parsed_header = header_parse(head);
resp.header = std::move(parsed_header.fields);
resp.header_list = std::move(parsed_header.fields);
assert(resp.code == parsed_header.code);
resp.http_ver = parsed_header.version;
resp.code_desc = parsed_header.message;

View file

@ -42,7 +42,7 @@ Header to_header (const nap::HttpResponse& resp) {
using dhandy::int_conv;
Header ret;
for (const auto& entry : resp.header) {
for (const auto& entry : resp.header_list) {
if (equal(entry.first, "Date"))
ret.date = from_header_timestamp(std::string(entry.second));
else if (equal(entry.first, "X-RateLimit-Limit"))