Christopher Faulet | 47596d3 | 2018-10-22 09:17:28 +0200 | [diff] [blame] | 1 | /* |
| 2 | * include/types/http_htx.h |
| 3 | * This file defines everything related to HTTP manipulation using the internal |
| 4 | * representation. |
| 5 | * |
| 6 | * Copyright (C) 2018 HAProxy Technologies, Christopher Faulet <cfaulet@haproxy.com> |
| 7 | * |
| 8 | * This library is free software; you can redistribute it and/or |
| 9 | * modify it under the terms of the GNU Lesser General Public |
| 10 | * License as published by the Free Software Foundation, version 2.1 |
| 11 | * exclusively. |
| 12 | * |
| 13 | * This library is distributed in the hope that it will be useful, |
| 14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
| 16 | * Lesser General Public License for more details. |
| 17 | * |
| 18 | * You should have received a copy of the GNU Lesser General Public |
| 19 | * License along with this library; if not, write to the Free Software |
| 20 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA |
| 21 | */ |
| 22 | |
| 23 | #ifndef _TYPES_HTTP_HTX_H |
| 24 | #define _TYPES_HTTP_HTX_H |
| 25 | |
Christopher Faulet | 5885775 | 2020-01-15 15:19:50 +0100 | [diff] [blame] | 26 | #include <ebistree.h> |
| 27 | |
| 28 | #include <common/buf.h> |
Christopher Faulet | 35cd81d | 2020-01-15 11:22:56 +0100 | [diff] [blame] | 29 | #include <common/http.h> |
Willy Tarreau | b96b77e | 2018-12-11 10:22:41 +0100 | [diff] [blame] | 30 | #include <common/htx.h> |
Christopher Faulet | 47596d3 | 2018-10-22 09:17:28 +0200 | [diff] [blame] | 31 | #include <common/ist.h> |
Christopher Faulet | 47596d3 | 2018-10-22 09:17:28 +0200 | [diff] [blame] | 32 | |
| 33 | /* Context used to find/remove an HTTP header. */ |
| 34 | struct http_hdr_ctx { |
| 35 | struct htx_blk *blk; |
| 36 | struct ist value; |
| 37 | uint16_t lws_before; |
| 38 | uint16_t lws_after; |
| 39 | }; |
| 40 | |
Christopher Faulet | 5885775 | 2020-01-15 15:19:50 +0100 | [diff] [blame] | 41 | /* A custom HTTP error message load from a row file and converted in HTX. The |
| 42 | * node key is the file path. |
| 43 | */ |
| 44 | struct http_error { |
| 45 | struct buffer msg; |
| 46 | struct ebpt_node node; |
| 47 | }; |
| 48 | |
Christopher Faulet | 35cd81d | 2020-01-15 11:22:56 +0100 | [diff] [blame] | 49 | /* http-errors section and parameters. */ |
| 50 | struct http_errors { |
| 51 | char *id; /* unique identifier */ |
| 52 | struct { |
| 53 | char *file; /* file where the section appears */ |
| 54 | int line; /* line where the section appears */ |
| 55 | } conf; /* config information */ |
| 56 | |
| 57 | struct buffer *errmsg[HTTP_ERR_SIZE]; /* customized error messages for known errors */ |
| 58 | struct list list; /* http-errors list */ |
| 59 | }; |
| 60 | |
Christopher Faulet | 47596d3 | 2018-10-22 09:17:28 +0200 | [diff] [blame] | 61 | #endif /* _TYPES_HTTP_HTX_H */ |