• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 // Copyright 2022 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4 
5 #ifndef QUICHE_BALSA_HTTP_VALIDATION_POLICY_H_
6 #define QUICHE_BALSA_HTTP_VALIDATION_POLICY_H_
7 
8 #include <ostream>
9 
10 #include "quiche/common/platform/api/quiche_export.h"
11 
12 namespace quiche {
13 
14 // An HttpValidationPolicy captures policy choices affecting parsing of HTTP
15 // requests.  It offers individual Boolean members to be consulted during the
16 // parsing of an HTTP request.
17 struct QUICHE_EXPORT HttpValidationPolicy {
18   // https://tools.ietf.org/html/rfc7230#section-3.2.4 deprecates "folding"
19   // of long header lines onto continuation lines.
20   bool disallow_header_continuation_lines = false;
21 
22   // A valid header line requires a header name and a colon.
23   bool require_header_colon = false;
24 
25   // https://tools.ietf.org/html/rfc7230#section-3.3.2 disallows multiple
26   // Content-Length header fields with the same value.
27   bool disallow_multiple_content_length = false;
28 
29   // https://tools.ietf.org/html/rfc7230#section-3.3.2 disallows
30   // Transfer-Encoding and Content-Length header fields together.
31   bool disallow_transfer_encoding_with_content_length = false;
32 };
33 
34 }  // namespace quiche
35 
36 #endif  // QUICHE_BALSA_HTTP_VALIDATION_POLICY_H_
37