#pragma once

#include <balancer/kernel/http/parser/http.h>

namespace NSrvKernel {

TChunkList FixedSizeEncode(TResponse response, TChunkList responseBody) {
    response.Headers().Add("Content-Length", ::ToString(responseBody.size()));
    TChunksOutputStream out;
    response.BuildTo(out);
    out << CRLF;
    TChunkList ret;
    ret = std::move(out.Chunks());
    ret.Append(std::move(responseBody));
    return ret;
}

}  // namespace NSrvKernel
