proxygen
|
#include <CodecUtil.h>
Public Types | |
enum | CtlEscapeMode { COMPLIANT, STRICT } |
Static Public Member Functions | |
static bool | validateURL (folly::ByteRange url) |
static bool | validateMethod (folly::ByteRange method) |
static bool | validateHeaderName (folly::ByteRange name) |
static bool | validateHeaderValue (folly::ByteRange value, CtlEscapeMode mode) |
static bool | hasGzipAndDeflate (const std::string &value, bool &hasGzip, bool &hasDeflate) |
static std::vector< compress::Header > | prepareMessageForCompression (const HTTPMessage &msg, std::vector< std::string > &temps) |
static bool | appendHeaders (const HTTPHeaders &inputHeaders, std::vector< compress::Header > &headers, HTTPHeaderCode headerToCheck) |
Static Public Attributes | |
static const char | http_tokens [256] |
Definition at line 23 of file CodecUtil.h.
RFC2616 allows certain control chars in header values if they are quoted and escaped. When mode is COMPLIANT, then this is allowed. When mode is STRICT, no escaped CTLs are allowed
Enumerator | |
---|---|
COMPLIANT | |
STRICT |
Definition at line 61 of file CodecUtil.h.
|
static |
Definition at line 131 of file CodecUtil.cpp.
References proxygen::HTTPHeaders::forEachWithCode(), proxygen::HTTP_HEADER_CONNECTION, proxygen::HTTP_HEADER_HOST, proxygen::HTTP_HEADER_KEEP_ALIVE, proxygen::HTTP_HEADER_PROXY_CONNECTION, proxygen::HTTP_HEADER_SEC_WEBSOCKET_ACCEPT, proxygen::HTTP_HEADER_SEC_WEBSOCKET_KEY, proxygen::HTTP_HEADER_TRANSFER_ENCODING, proxygen::HTTP_HEADER_UPGRADE, name, string, and value.
Referenced by proxygen::HTTP2Codec::generateTrailers(), prepareMessageForCompression(), and validateHeaderValue().
|
static |
Definition at line 61 of file CodecUtil.cpp.
References gmock_output_test::output, proxygen::RFC2616::parseQvalues(), string, and folly::pushmi::operators::transform.
Referenced by proxygen::SPDYCodec::parseHeaders(), and validateHeaderValue().
|
static |
Definition at line 82 of file CodecUtil.cpp.
References appendHeaders(), proxygen::CONNECT, proxygen::HTTPMessage::formatDateHeader(), proxygen::HTTPMessage::getHeaders(), proxygen::HTTPMessage::getMethod(), proxygen::HTTPMessage::getMethodString(), proxygen::HTTPHeaders::getSingleOrEmpty(), proxygen::HTTPMessage::getStatusCode(), proxygen::HTTPMessage::getURL(), proxygen::HTTP_HEADER_COLON_AUTHORITY, proxygen::HTTP_HEADER_COLON_METHOD, proxygen::HTTP_HEADER_COLON_PATH, proxygen::HTTP_HEADER_COLON_PROTOCOL, proxygen::HTTP_HEADER_COLON_SCHEME, proxygen::HTTP_HEADER_COLON_STATUS, proxygen::HTTP_HEADER_DATE, proxygen::HTTP_HEADER_HOST, proxygen::HTTPMessage::isEgressWebsocketUpgrade(), proxygen::HTTPMessage::isRequest(), proxygen::HTTPMessage::isResponse(), proxygen::HTTPMessage::isSecure(), proxygen::headers::kHttp, proxygen::headers::kHttps, proxygen::headers::kStatus200, proxygen::headers::kWebsocketString, proxygen::methodToString(), and string.
Referenced by proxygen::HTTP2Codec::generateHeaderImpl(), and validateHeaderValue().
|
inlinestatic |
Definition at line 43 of file CodecUtil.h.
References folly::Range< Iter >::size(), and uint8_t.
Referenced by proxygen::HeaderDecodeInfo::onHeader(), and proxygen::SPDYCodec::parseHeaders().
|
inlinestatic |
Definition at line 66 of file CodecUtil.h.
References appendHeaders(), folly::test::begin(), COMPLIANT, folly::test::end(), hasGzipAndDeflate(), prepareMessageForCompression(), quote, string, and value.
Referenced by proxygen::HeaderDecodeInfo::onHeader(), proxygen::SPDYCodec::parseHeaders(), and proxygen::HTTPRequestVerifier::setAuthority().
|
inlinestatic |
Definition at line 33 of file CodecUtil.h.
Referenced by proxygen::SPDYCodec::parseHeaders(), proxygen::HTTPRequestVerifier::setMethod(), and proxygen::HTTPRequestVerifier::setScheme().
|
inlinestatic |
Definition at line 29 of file CodecUtil.h.
References proxygen::validateURL().
Referenced by proxygen::SPDYCodec::parseHeaders(), and proxygen::HTTPRequestVerifier::setPath().
|
static |
Tokens as defined by rfc 2616. Also lowercases them. token = 1*<any char="" except="" ctls="" or="" separators>=""> separators = "(" | ")" | "<" | ">" | "@" | "," | ";" | ":" | "\" | <"> | "/" | "[" | "]" | "?" | "=" | "{" | "}" | SP | HT
Definition at line 27 of file CodecUtil.h.