| QUICHE team | d7a507e | 2022-04-15 14:35:46 -0700 | [diff] [blame] | 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 | |
| bnc | 30bbde7 | 2022-05-12 06:41:23 -0700 | [diff] [blame] | 5 | #ifndef QUICHE_BALSA_HTTP_VALIDATION_POLICY_H_ |
| 6 | #define QUICHE_BALSA_HTTP_VALIDATION_POLICY_H_ |
| QUICHE team | d7a507e | 2022-04-15 14:35:46 -0700 | [diff] [blame] | 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 |
| bnc | 1fdac9b | 2023-01-27 13:14:37 -0800 | [diff] [blame] | 15 | // requests. It offers individual Boolean members to be consulted during the |
| 16 | // parsing of an HTTP request. |
| 17 | struct QUICHE_EXPORT HttpValidationPolicy { |
| QUICHE team | d7a507e | 2022-04-15 14:35:46 -0700 | [diff] [blame] | 18 | // https://tools.ietf.org/html/rfc7230#section-3.2.4 deprecates "folding" |
| 19 | // of long header lines onto continuation lines. |
| bnc | 1fdac9b | 2023-01-27 13:14:37 -0800 | [diff] [blame] | 20 | bool disallow_header_continuation_lines = false; |
| QUICHE team | d7a507e | 2022-04-15 14:35:46 -0700 | [diff] [blame] | 21 | |
| 22 | // A valid header line requires a header name and a colon. |
| bnc | 1fdac9b | 2023-01-27 13:14:37 -0800 | [diff] [blame] | 23 | bool require_header_colon = false; |
| QUICHE team | d7a507e | 2022-04-15 14:35:46 -0700 | [diff] [blame] | 24 | |
| 25 | // https://tools.ietf.org/html/rfc7230#section-3.3.2 disallows multiple |
| 26 | // Content-Length header fields with the same value. |
| bnc | 1fdac9b | 2023-01-27 13:14:37 -0800 | [diff] [blame] | 27 | bool disallow_multiple_content_length = false; |
| QUICHE team | d7a507e | 2022-04-15 14:35:46 -0700 | [diff] [blame] | 28 | |
| 29 | // https://tools.ietf.org/html/rfc7230#section-3.3.2 disallows |
| 30 | // Transfer-Encoding and Content-Length header fields together. |
| bnc | 1fdac9b | 2023-01-27 13:14:37 -0800 | [diff] [blame] | 31 | bool disallow_transfer_encoding_with_content_length = false; |
| QUICHE team | d7a507e | 2022-04-15 14:35:46 -0700 | [diff] [blame] | 32 | }; |
| 33 | |
| 34 | } // namespace quiche |
| 35 | |
| bnc | 30bbde7 | 2022-05-12 06:41:23 -0700 | [diff] [blame] | 36 | #endif // QUICHE_BALSA_HTTP_VALIDATION_POLICY_H_ |