Deprecate --gfe2_reloadable_flag_always_use_strict_header_names.
PiperOrigin-RevId: 444316025
diff --git a/quiche/common/balsa/balsa_frame.cc b/quiche/common/balsa/balsa_frame.cc
index 7eecb7a..c50e16d 100644
--- a/quiche/common/balsa/balsa_frame.cc
+++ b/quiche/common/balsa/balsa_frame.cc
@@ -319,8 +319,8 @@
const char* stream_begin = headers->OriginalHeaderStreamBegin();
// The last line is always just a newline (and is uninteresting).
const Lines::size_type lines_size_m1 = lines.size() - 1;
- // For a trailer, there is no first line, so lines[0] is the first header
- // . For real headers, the first line takes lines[0], so real header starts
+ // For a trailer, there is no first line, so lines[0] is the first header.
+ // For real headers, the first line takes lines[0], so real header starts
// at index 1.
int first_header_idx = (is_trailer ? 0 : 1);
const char* current = stream_begin + lines[first_header_idx].first;
@@ -408,8 +408,7 @@
break;
}
- if (http_validation_policy().enforce_header_characters() &&
- IsInvalidHeaderKeyChar(*current)) {
+ if (IsInvalidHeaderKeyChar(*current)) {
// Generally invalid characters were found earlier.
HandleError(is_trailer
? BalsaFrameEnums::INVALID_TRAILER_NAME_CHARACTER
diff --git a/quiche/common/balsa/http_validation_policy.cc b/quiche/common/balsa/http_validation_policy.cc
index b0418ec..4d44efa 100644
--- a/quiche/common/balsa/http_validation_policy.cc
+++ b/quiche/common/balsa/http_validation_policy.cc
@@ -10,21 +10,15 @@
namespace quiche {
-HttpValidationPolicy::HttpValidationPolicy(bool enforce_header_keys,
- bool enforce_all)
- : enforce_header_keys_(enforce_header_keys), enforce_all_(enforce_all) {
- if (enforce_all_) {
- QUICHE_DCHECK(enforce_header_keys_);
- }
-}
+HttpValidationPolicy::HttpValidationPolicy(bool enforce_all)
+ : enforce_all_(enforce_all) {}
HttpValidationPolicy HttpValidationPolicy::CreateDefault() {
- return HttpValidationPolicy(true, false);
+ return HttpValidationPolicy(false);
}
bool HttpValidationPolicy::operator==(const HttpValidationPolicy& other) const {
- return std::tie(enforce_header_keys_, enforce_all_) ==
- std::tie(other.enforce_header_keys_, other.enforce_all_);
+ return enforce_all_ == other.enforce_all_;
}
} // namespace quiche
diff --git a/quiche/common/balsa/http_validation_policy.h b/quiche/common/balsa/http_validation_policy.h
index 3b75ec7..a98a08b 100644
--- a/quiche/common/balsa/http_validation_policy.h
+++ b/quiche/common/balsa/http_validation_policy.h
@@ -16,13 +16,10 @@
// during the parsing of an HTTP request.
class QUICHE_EXPORT_PRIVATE HttpValidationPolicy {
public:
- HttpValidationPolicy(bool enforce_header_keys, bool enforce_all);
+ HttpValidationPolicy(bool enforce_all);
static HttpValidationPolicy CreateDefault();
- // A header name has to be drawn from a set of allowed characters.
- bool enforce_header_characters() const { return enforce_header_keys_; }
-
// https://tools.ietf.org/html/rfc7230#section-3.2.4 deprecates "folding"
// of long header lines onto continuation lines.
bool disallow_header_continuation_lines() const { return enforce_all_; }
@@ -44,15 +41,11 @@
friend QUICHE_EXPORT_PRIVATE std::ostream& operator<<(
std::ostream& os, const HttpValidationPolicy& policy) {
- os << "HttpValidationPolicy(enforce_header_keys_="
- << policy.enforce_header_keys_
- << ", enforce_all_=" << policy.enforce_all_ << ")";
+ os << "HttpValidationPolicy(enforce_all_=" << policy.enforce_all_ << ")";
return os;
}
private:
- // Enforce more standard-compliant parsing of HTTP headers.
- bool enforce_header_keys_;
// Enforce "everything": set for strictest possible parsing.
bool enforce_all_;
};