if (unlikely(ctl) && http_path_has_forbidden_char(list[idx].v, ctl))
goto fail;
} else {
- ctl = ist_find_http_ctl(list[idx].v);
- if (unlikely(ctl) && http_header_has_forbidden_char(list[idx].v, ctl))
+ if (http_header_has_forbidden_char(list[idx].v, istptr(list[idx].v)))
goto fail;
}
int i;
struct htx_sl *sl = NULL;
unsigned int sl_flags = 0;
- const char *ctl;
struct ist v;
fields = 0;
/* RFC7540#10.3: intermediaries forwarding to HTTP/1 must take care of
* rejecting NUL, CR and LF characters.
*/
- ctl = ist_find_http_ctl(list[idx].v);
- if (unlikely(ctl) && http_header_has_forbidden_char(list[idx].v, ctl))
+ if (unlikely(http_header_has_forbidden_char(list[idx].v, istptr(list[idx].v))))
goto fail;
if (phdr > 0 && phdr < H2_PHDR_NUM_ENTRIES) {
static int _h3_handle_phdr(struct qcs *qcs, const struct http_hdr *h)
{
/* look for forbidden control characters in the pseudo-header value */
- const char *ctl = ist_find_http_ctl(h->v);
- if (unlikely(ctl) && http_header_has_forbidden_char(h->v, ctl)) {
+ if (unlikely(http_header_has_forbidden_char(h->v, istptr(h->v)))) {
TRACE_ERROR("control character present in pseudo-header value", H3_EV_RX_FRAME|H3_EV_RX_HDR, qcs->qcc->conn, qcs);
goto err;
}
{
const struct ist name = hdr->n;
const struct ist value = hdr->v;
- const char *ctl;
int i;
if (isteq(name, ist("")))
*/
/* look for forbidden control characters in the header value */
- ctl = ist_find_http_ctl(value);
- if (unlikely(ctl) && http_header_has_forbidden_char(value, ctl)) {
+ if (unlikely(http_header_has_forbidden_char(value, istptr(value)))) {
TRACE_ERROR("control character present in header value", H3_EV_RX_FRAME|H3_EV_RX_HDR, qcs->qcc->conn, qcs);
goto err;
}
{
uint32_t data_ofs = htx->data; /* used to rollback on error */
enum http_parser_status ret = HTTP_PRS_SUCCESS;
- const char *ctl;
struct ist v;
uint32_t idx;
int i;
* response that contains a character not permitted in a field
* value MUST be treated as malformed
*/
- ctl = ist_find_http_ctl(list[idx].v);
- if (unlikely(ctl) && http_header_has_forbidden_char(list[idx].v, ctl)) {
+ if (unlikely(http_header_has_forbidden_char(list[idx].v, istptr(list[idx].v)))) {
ret = HTTP_PRS_INV_HVAL;
goto fail;
}