Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 6 additions & 4 deletions src/envoy/mixer/http_control.cc
Original file line number Diff line number Diff line change
Expand Up @@ -108,10 +108,12 @@ void FillRequestHeaderAttributes(const HeaderMap& header_map,
StringMapValue(ExtractHeaders(header_map));
}

void FillResponseHeaderAttributes(const HeaderMap& header_map,
void FillResponseHeaderAttributes(const HeaderMap* header_map,
Attributes* attr) {
attr->attributes[kResponseHeaders] =
StringMapValue(ExtractHeaders(header_map));
if (header_map) {
attr->attributes[kResponseHeaders] =
StringMapValue(ExtractHeaders(*header_map));
}
attr->attributes[kResponseTime] = TimeValue(std::chrono::system_clock::now());
}

Expand Down Expand Up @@ -180,7 +182,7 @@ void HttpControl::Report(HttpRequestDataPtr request_data,
int check_status, DoneFunc on_done) {
// Use all Check attributes for Report.
// Add additional Report attributes.
FillResponseHeaderAttributes(*response_headers, &request_data->attributes);
FillResponseHeaderAttributes(response_headers, &request_data->attributes);
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

just curious, in what situation response_headers will be nullptr?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

GET

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

hm, weird. GET should have response_headers as well..


FillRequestInfoAttributes(request_info, check_status,
&request_data->attributes);
Expand Down