| 970 | } |
| 971 | |
| 972 | void SendMinimalHttpRequest(TSocket& s, const TStringBuf& host, const TStringBuf& request, const TStringBuf& agent, const TStringBuf& from) { |
| 973 | TSocketOutput so(s); |
| 974 | THttpOutput output(&so); |
| 975 | |
| 976 | output.EnableKeepAlive(false); |
| 977 | output.EnableCompression(false); |
| 978 | |
| 979 | const IOutputStream::TPart parts[] = { |
| 980 | IOutputStream::TPart(TStringBuf("GET ")), |
| 981 | IOutputStream::TPart(request), |
| 982 | IOutputStream::TPart(TStringBuf(" HTTP/1.1")), |
| 983 | IOutputStream::TPart::CrLf(), |
| 984 | IOutputStream::TPart(TStringBuf("Host: ")), |
| 985 | IOutputStream::TPart(host), |
| 986 | IOutputStream::TPart::CrLf(), |
| 987 | IOutputStream::TPart(TStringBuf("User-Agent: ")), |
| 988 | IOutputStream::TPart(agent), |
| 989 | IOutputStream::TPart::CrLf(), |
| 990 | IOutputStream::TPart(TStringBuf("From: ")), |
| 991 | IOutputStream::TPart(from), |
| 992 | IOutputStream::TPart::CrLf(), |
| 993 | IOutputStream::TPart::CrLf(), |
| 994 | }; |
| 995 | |
| 996 | output.Write(parts, sizeof(parts) / sizeof(*parts)); |
| 997 | output.Finish(); |
| 998 | } |
| 999 | |
| 1000 | TArrayRef<const TStringBuf> SupportedCodings() { |
| 1001 | return TCompressionCodecFactory::Instance().GetBestCodecs(); |
no test coverage detected