Simplify HttpHeaderCreator::init_status_line.

GitOrigin-RevId: 6c2962fcf126025a2b3066ade41baa9a2ba327d3
This commit is contained in:
levlam 2020-06-09 03:44:16 +03:00
parent e8dba312fe
commit 708ff55066

View File

@ -35,8 +35,7 @@ class HttpHeaderCreator {
sb_ << "HTTP/1.1 " << code << " " << reason << "\r\n";
}
void init_status_line(int http_status_code) {
sb_ = StringBuilder(MutableSlice{header_, MAX_HEADER});
sb_ << "HTTP/1.1 " << http_status_code << " " << get_status_line(http_status_code) << "\r\n";
init_error(http_status_code, get_status_line(http_status_code));
}
void add_header(Slice key, Slice value) {
sb_ << key << ": " << value << "\r\n";