blob: 725f48ee7ebf3105d3e44bd05bb34335cbdb9d80 [file] [log] [blame]
QUICHE teamd7a507e2022-04-15 14:35:46 -07001// 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
bnc30bbde72022-05-12 06:41:23 -07005#ifndef QUICHE_BALSA_HTTP_VALIDATION_POLICY_H_
6#define QUICHE_BALSA_HTTP_VALIDATION_POLICY_H_
QUICHE teamd7a507e2022-04-15 14:35:46 -07007
8#include <ostream>
9
10#include "quiche/common/platform/api/quiche_export.h"
11
12namespace quiche {
13
14// An HttpValidationPolicy captures policy choices affecting parsing of HTTP
bnc1fdac9b2023-01-27 13:14:37 -080015// requests. It offers individual Boolean members to be consulted during the
16// parsing of an HTTP request.
17struct QUICHE_EXPORT HttpValidationPolicy {
QUICHE teamd7a507e2022-04-15 14:35:46 -070018 // https://tools.ietf.org/html/rfc7230#section-3.2.4 deprecates "folding"
19 // of long header lines onto continuation lines.
bnc1fdac9b2023-01-27 13:14:37 -080020 bool disallow_header_continuation_lines = false;
QUICHE teamd7a507e2022-04-15 14:35:46 -070021
22 // A valid header line requires a header name and a colon.
bnc1fdac9b2023-01-27 13:14:37 -080023 bool require_header_colon = false;
QUICHE teamd7a507e2022-04-15 14:35:46 -070024
25 // https://tools.ietf.org/html/rfc7230#section-3.3.2 disallows multiple
26 // Content-Length header fields with the same value.
bnc1fdac9b2023-01-27 13:14:37 -080027 bool disallow_multiple_content_length = false;
QUICHE teamd7a507e2022-04-15 14:35:46 -070028
29 // https://tools.ietf.org/html/rfc7230#section-3.3.2 disallows
30 // Transfer-Encoding and Content-Length header fields together.
bnc1fdac9b2023-01-27 13:14:37 -080031 bool disallow_transfer_encoding_with_content_length = false;
QUICHE teamd7a507e2022-04-15 14:35:46 -070032};
33
34} // namespace quiche
35
bnc30bbde72022-05-12 06:41:23 -070036#endif // QUICHE_BALSA_HTTP_VALIDATION_POLICY_H_