MCPcopy Create free account
hub / github.com/catboost/catboost / SafeWriteHeaders

Function SafeWriteHeaders

library/cpp/neh/http_common.cpp:100–108  ·  view source on GitHub ↗

@brief SafeWriteHeaders write headers from hdrs to out with some checks: - filter out Content-Lenthgh because we'll add it ourselfs later. @todo ensure headers right formatted (now receive from perl report bad format headers) */

Source from the content-addressed store, hash-verified

98 @todo ensure headers right formatted (now receive from perl report bad format headers)
99 */
100 void SafeWriteHeaders(IOutputStream& out, TStringBuf hdrs) {
101 NNeh::NHttp::THeaderSplitter splitter(hdrs);
102 TStringBuf msgHdr;
103 while (splitter.Next(msgHdr)) {
104 if (!AsciiHasPrefixIgnoreCase(msgHdr, TStringBuf("Content-Length"))) {
105 out << msgHdr << TStringBuf("\r\n");
106 }
107 }
108 }
109
110 template <typename T, typename W>
111 TString BuildRequest(const NNeh::TParsedLocation& loc, const T& urlParams, const TStringBuf headers, const W& content, const TStringBuf contentType, ERequestType requestType, NNeh::NHttp::ERequestFlags requestFlags) {

Callers 1

BuildRequestFunction · 0.85

Calls 2

AsciiHasPrefixIgnoreCaseFunction · 0.85
NextMethod · 0.45

Tested by

no test coverage detected