@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) */
| 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) { |
no test coverage detected