| 337 | } |
| 338 | |
| 339 | void THttpParser::ApplyHeaderLine(const TStringBuf& name, const TStringBuf& val) { |
| 340 | if (AsciiEqualsIgnoreCase(name, TStringBuf("connection"))) { |
| 341 | KeepAlive_ = AsciiEqualsIgnoreCase(val, TStringBuf("keep-alive")); |
| 342 | } else if (AsciiEqualsIgnoreCase(name, TStringBuf("content-length"))) { |
| 343 | Y_ENSURE(val.size(), "NEH: Content-Length cannot be empty string. "); |
| 344 | ContentLength_ = FromString<ui64>(val); |
| 345 | HasContentLength_ = true; |
| 346 | } else if (AsciiEqualsIgnoreCase(name, TStringBuf("transfer-encoding"))) { |
| 347 | if (AsciiEqualsIgnoreCase(val, TStringBuf("chunked"))) { |
| 348 | ChunkInputState_ = new TChunkInputState(); |
| 349 | } |
| 350 | } else if (AsciiEqualsIgnoreCase(name, TStringBuf("accept-encoding"))) { |
| 351 | TStringBuf encodings(val); |
| 352 | while (encodings.size()) { |
| 353 | TStringBuf enc = encodings.NextTok(',').After(' ').Before(' '); |
| 354 | if (!enc) { |
| 355 | continue; |
| 356 | } |
| 357 | TString s(enc); |
| 358 | s.to_lower(); |
| 359 | AcceptEncodings_.insert(s); |
| 360 | } |
| 361 | } else if (AsciiEqualsIgnoreCase(name, TStringBuf("content-encoding"))) { |
| 362 | TString s(val); |
| 363 | s.to_lower(); |
| 364 | ContentEncoding_ = s; |
| 365 | } |
| 366 | } |