#include "quiche/http2/adapter/header_validator.h"
#include <array>
#include <bitset>
#include <string>
#include "absl/strings/ascii.h"
#include "absl/strings/escaping.h"
#include "absl/strings/numbers.h"
#include "absl/strings/str_cat.h"
#include "quiche/http2/adapter/header_validator_base.h"
#include "quiche/http2/http2_constants.h"
#include "quiche/common/platform/api/quiche_logging.h"
namespace http2 {
namespace adapter {
namespace {
constexpr absl::string_view kHttpTokenChars = …;
constexpr absl::string_view kHttp2HeaderNameAllowedChars = …;
constexpr absl::string_view kHttp2HeaderValueAllowedChars = …;
constexpr absl::string_view kHttp2StatusValueAllowedChars = …;
constexpr absl::string_view kValidAuthorityChars = …;
constexpr absl::string_view kValidPathChars = …;
constexpr absl::string_view kValidPathCharsWithFragment = …;
CharMap;
constexpr CharMap BuildValidCharMap(absl::string_view valid_chars) { … }
constexpr CharMap AllowObsText(CharMap map) { … }
bool AllCharsInMap(absl::string_view str, const CharMap& map) { … }
bool IsValidStatus(absl::string_view status) { … }
bool IsValidMethod(absl::string_view method) { … }
}
void HeaderValidator::StartHeaderBlock() { … }
void HeaderValidator::RecordPseudoHeader(PseudoHeaderTag tag) { … }
HeaderValidator::HeaderStatus HeaderValidator::ValidateSingleHeader(
absl::string_view key, absl::string_view value) { … }
bool HeaderValidator::FinishHeaderBlock(HeaderType type) { … }
bool HeaderValidator::IsValidHeaderName(absl::string_view name) { … }
bool HeaderValidator::IsValidHeaderValue(absl::string_view value,
ObsTextOption option) { … }
bool HeaderValidator::IsValidAuthority(absl::string_view authority) { … }
bool HeaderValidator::IsValidPath(absl::string_view path, bool allow_fragment) { … }
HeaderValidator::ContentLengthStatus HeaderValidator::HandleContentLength(
absl::string_view value) { … }
bool HeaderValidator::ValidateAndSetAuthority(absl::string_view authority) { … }
bool HeaderValidator::ValidateRequestHeaders(
const PseudoHeaderTagSet& pseudo_headers,
const PseudoHeaderStateSet& pseudo_header_state,
bool allow_extended_connect) { … }
bool HeaderValidator::ValidateRequestTrailers(
const PseudoHeaderTagSet& pseudo_headers) { … }
bool HeaderValidator::ValidateResponseHeaders(
const PseudoHeaderTagSet& pseudo_headers) { … }
bool HeaderValidator::ValidateResponseTrailers(
const PseudoHeaderTagSet& pseudo_headers) { … }
}
}