Coverage Report

Created: 2023-06-07 07:02

/src/nghttp2/lib/nghttp2_http.c
Line
Count
Source (jump to first uncovered line)
1
/*
2
 * nghttp2 - HTTP/2 C Library
3
 *
4
 * Copyright (c) 2015 Tatsuhiro Tsujikawa
5
 *
6
 * Permission is hereby granted, free of charge, to any person obtaining
7
 * a copy of this software and associated documentation files (the
8
 * "Software"), to deal in the Software without restriction, including
9
 * without limitation the rights to use, copy, modify, merge, publish,
10
 * distribute, sublicense, and/or sell copies of the Software, and to
11
 * permit persons to whom the Software is furnished to do so, subject to
12
 * the following conditions:
13
 *
14
 * The above copyright notice and this permission notice shall be
15
 * included in all copies or substantial portions of the Software.
16
 *
17
 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
18
 * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
19
 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
20
 * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
21
 * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
22
 * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
23
 * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
24
 */
25
#include "nghttp2_http.h"
26
27
#include <string.h>
28
#include <assert.h>
29
#include <stdio.h>
30
31
#include "nghttp2_hd.h"
32
#include "nghttp2_helper.h"
33
34
0
static uint8_t downcase(uint8_t c) {
35
0
  return 'A' <= c && c <= 'Z' ? (uint8_t)(c - 'A' + 'a') : c;
36
0
}
37
38
0
static int memieq(const void *a, const void *b, size_t n) {
39
0
  size_t i;
40
0
  const uint8_t *aa = a, *bb = b;
41
42
0
  for (i = 0; i < n; ++i) {
43
0
    if (downcase(aa[i]) != downcase(bb[i])) {
44
0
      return 0;
45
0
    }
46
0
  }
47
0
  return 1;
48
0
}
49
50
0
#define lstrieq(A, B, N) ((sizeof((A)) - 1) == (N) && memieq((A), (B), (N)))
51
52
0
static int64_t parse_uint(const uint8_t *s, size_t len) {
53
0
  int64_t n = 0;
54
0
  size_t i;
55
0
  if (len == 0) {
56
0
    return -1;
57
0
  }
58
0
  for (i = 0; i < len; ++i) {
59
0
    if ('0' <= s[i] && s[i] <= '9') {
60
0
      if (n > INT64_MAX / 10) {
61
0
        return -1;
62
0
      }
63
0
      n *= 10;
64
0
      if (n > INT64_MAX - (s[i] - '0')) {
65
0
        return -1;
66
0
      }
67
0
      n += s[i] - '0';
68
0
      continue;
69
0
    }
70
0
    return -1;
71
0
  }
72
0
  return n;
73
0
}
74
75
0
static int lws(const uint8_t *s, size_t n) {
76
0
  size_t i;
77
0
  for (i = 0; i < n; ++i) {
78
0
    if (s[i] != ' ' && s[i] != '\t') {
79
0
      return 0;
80
0
    }
81
0
  }
82
0
  return 1;
83
0
}
84
85
static int check_pseudo_header(nghttp2_stream *stream, const nghttp2_hd_nv *nv,
86
0
                               int flag) {
87
0
  if (stream->http_flags & flag) {
88
0
    return 0;
89
0
  }
90
0
  if (lws(nv->value->base, nv->value->len)) {
91
0
    return 0;
92
0
  }
93
0
  stream->http_flags = (uint16_t)(stream->http_flags | flag);
94
0
  return 1;
95
0
}
96
97
0
static int expect_response_body(nghttp2_stream *stream) {
98
0
  return (stream->http_flags & NGHTTP2_HTTP_FLAG_METH_HEAD) == 0 &&
99
0
         stream->status_code / 100 != 1 && stream->status_code != 304 &&
100
0
         stream->status_code != 204;
101
0
}
102
103
/* For "http" or "https" URIs, OPTIONS request may have "*" in :path
104
   header field to represent system-wide OPTIONS request.  Otherwise,
105
   :path header field value must start with "/".  This function must
106
   be called after ":method" header field was received.  This function
107
   returns nonzero if path is valid.*/
108
0
static int check_path(nghttp2_stream *stream) {
109
0
  return (stream->http_flags & NGHTTP2_HTTP_FLAG_SCHEME_HTTP) == 0 ||
110
0
         ((stream->http_flags & NGHTTP2_HTTP_FLAG_PATH_REGULAR) ||
111
0
          ((stream->http_flags & NGHTTP2_HTTP_FLAG_METH_OPTIONS) &&
112
0
           (stream->http_flags & NGHTTP2_HTTP_FLAG_PATH_ASTERISK)));
113
0
}
114
115
static int http_request_on_header(nghttp2_stream *stream, nghttp2_hd_nv *nv,
116
0
                                  int trailer, int connect_protocol) {
117
0
  if (nv->name->base[0] == ':') {
118
0
    if (trailer ||
119
0
        (stream->http_flags & NGHTTP2_HTTP_FLAG_PSEUDO_HEADER_DISALLOWED)) {
120
0
      return NGHTTP2_ERR_HTTP_HEADER;
121
0
    }
122
0
  }
123
124
0
  switch (nv->token) {
125
0
  case NGHTTP2_TOKEN__AUTHORITY:
126
0
    if (!check_pseudo_header(stream, nv, NGHTTP2_HTTP_FLAG__AUTHORITY)) {
127
0
      return NGHTTP2_ERR_HTTP_HEADER;
128
0
    }
129
0
    break;
130
0
  case NGHTTP2_TOKEN__METHOD:
131
0
    if (!check_pseudo_header(stream, nv, NGHTTP2_HTTP_FLAG__METHOD)) {
132
0
      return NGHTTP2_ERR_HTTP_HEADER;
133
0
    }
134
0
    switch (nv->value->len) {
135
0
    case 4:
136
0
      if (lstreq("HEAD", nv->value->base, nv->value->len)) {
137
0
        stream->http_flags |= NGHTTP2_HTTP_FLAG_METH_HEAD;
138
0
      }
139
0
      break;
140
0
    case 7:
141
0
      switch (nv->value->base[6]) {
142
0
      case 'T':
143
0
        if (lstreq("CONNECT", nv->value->base, nv->value->len)) {
144
0
          if (stream->stream_id % 2 == 0) {
145
            /* we won't allow CONNECT for push */
146
0
            return NGHTTP2_ERR_HTTP_HEADER;
147
0
          }
148
0
          stream->http_flags |= NGHTTP2_HTTP_FLAG_METH_CONNECT;
149
0
        }
150
0
        break;
151
0
      case 'S':
152
0
        if (lstreq("OPTIONS", nv->value->base, nv->value->len)) {
153
0
          stream->http_flags |= NGHTTP2_HTTP_FLAG_METH_OPTIONS;
154
0
        }
155
0
        break;
156
0
      }
157
0
      break;
158
0
    }
159
0
    break;
160
0
  case NGHTTP2_TOKEN__PATH:
161
0
    if (!check_pseudo_header(stream, nv, NGHTTP2_HTTP_FLAG__PATH)) {
162
0
      return NGHTTP2_ERR_HTTP_HEADER;
163
0
    }
164
0
    if (nv->value->base[0] == '/') {
165
0
      stream->http_flags |= NGHTTP2_HTTP_FLAG_PATH_REGULAR;
166
0
    } else if (nv->value->len == 1 && nv->value->base[0] == '*') {
167
0
      stream->http_flags |= NGHTTP2_HTTP_FLAG_PATH_ASTERISK;
168
0
    }
169
0
    break;
170
0
  case NGHTTP2_TOKEN__SCHEME:
171
0
    if (!check_pseudo_header(stream, nv, NGHTTP2_HTTP_FLAG__SCHEME)) {
172
0
      return NGHTTP2_ERR_HTTP_HEADER;
173
0
    }
174
0
    if ((nv->value->len == 4 && memieq("http", nv->value->base, 4)) ||
175
0
        (nv->value->len == 5 && memieq("https", nv->value->base, 5))) {
176
0
      stream->http_flags |= NGHTTP2_HTTP_FLAG_SCHEME_HTTP;
177
0
    }
178
0
    break;
179
0
  case NGHTTP2_TOKEN__PROTOCOL:
180
0
    if (!connect_protocol) {
181
0
      return NGHTTP2_ERR_HTTP_HEADER;
182
0
    }
183
184
0
    if (!check_pseudo_header(stream, nv, NGHTTP2_HTTP_FLAG__PROTOCOL)) {
185
0
      return NGHTTP2_ERR_HTTP_HEADER;
186
0
    }
187
0
    break;
188
0
  case NGHTTP2_TOKEN_HOST:
189
0
    if (!check_pseudo_header(stream, nv, NGHTTP2_HTTP_FLAG_HOST)) {
190
0
      return NGHTTP2_ERR_HTTP_HEADER;
191
0
    }
192
0
    break;
193
0
  case NGHTTP2_TOKEN_CONTENT_LENGTH: {
194
0
    if (stream->content_length != -1) {
195
0
      return NGHTTP2_ERR_HTTP_HEADER;
196
0
    }
197
0
    stream->content_length = parse_uint(nv->value->base, nv->value->len);
198
0
    if (stream->content_length == -1) {
199
0
      return NGHTTP2_ERR_HTTP_HEADER;
200
0
    }
201
0
    break;
202
0
  }
203
  /* disallowed header fields */
204
0
  case NGHTTP2_TOKEN_CONNECTION:
205
0
  case NGHTTP2_TOKEN_KEEP_ALIVE:
206
0
  case NGHTTP2_TOKEN_PROXY_CONNECTION:
207
0
  case NGHTTP2_TOKEN_TRANSFER_ENCODING:
208
0
  case NGHTTP2_TOKEN_UPGRADE:
209
0
    return NGHTTP2_ERR_HTTP_HEADER;
210
0
  case NGHTTP2_TOKEN_TE:
211
0
    if (!lstrieq("trailers", nv->value->base, nv->value->len)) {
212
0
      return NGHTTP2_ERR_HTTP_HEADER;
213
0
    }
214
0
    break;
215
0
  default:
216
0
    if (nv->name->base[0] == ':') {
217
0
      return NGHTTP2_ERR_HTTP_HEADER;
218
0
    }
219
0
  }
220
221
0
  if (nv->name->base[0] != ':') {
222
0
    stream->http_flags |= NGHTTP2_HTTP_FLAG_PSEUDO_HEADER_DISALLOWED;
223
0
  }
224
225
0
  return 0;
226
0
}
227
228
static int http_response_on_header(nghttp2_stream *stream, nghttp2_hd_nv *nv,
229
0
                                   int trailer) {
230
0
  if (nv->name->base[0] == ':') {
231
0
    if (trailer ||
232
0
        (stream->http_flags & NGHTTP2_HTTP_FLAG_PSEUDO_HEADER_DISALLOWED)) {
233
0
      return NGHTTP2_ERR_HTTP_HEADER;
234
0
    }
235
0
  }
236
237
0
  switch (nv->token) {
238
0
  case NGHTTP2_TOKEN__STATUS: {
239
0
    if (!check_pseudo_header(stream, nv, NGHTTP2_HTTP_FLAG__STATUS)) {
240
0
      return NGHTTP2_ERR_HTTP_HEADER;
241
0
    }
242
0
    if (nv->value->len != 3) {
243
0
      return NGHTTP2_ERR_HTTP_HEADER;
244
0
    }
245
0
    stream->status_code = (int16_t)parse_uint(nv->value->base, nv->value->len);
246
0
    if (stream->status_code == -1 || stream->status_code == 101) {
247
0
      return NGHTTP2_ERR_HTTP_HEADER;
248
0
    }
249
0
    break;
250
0
  }
251
0
  case NGHTTP2_TOKEN_CONTENT_LENGTH: {
252
0
    if (stream->status_code == 204) {
253
      /* content-length header field in 204 response is prohibited by
254
         RFC 7230.  But some widely used servers send content-length:
255
         0.  Until they get fixed, we ignore it. */
256
0
      if (stream->content_length != -1) {
257
        /* Found multiple content-length field */
258
0
        return NGHTTP2_ERR_HTTP_HEADER;
259
0
      }
260
0
      if (!lstrieq("0", nv->value->base, nv->value->len)) {
261
0
        return NGHTTP2_ERR_HTTP_HEADER;
262
0
      }
263
0
      stream->content_length = 0;
264
0
      return NGHTTP2_ERR_REMOVE_HTTP_HEADER;
265
0
    }
266
0
    if (stream->status_code / 100 == 1) {
267
0
      return NGHTTP2_ERR_HTTP_HEADER;
268
0
    }
269
    /* https://tools.ietf.org/html/rfc7230#section-3.3.3 */
270
0
    if (stream->status_code / 100 == 2 &&
271
0
        (stream->http_flags & NGHTTP2_HTTP_FLAG_METH_CONNECT)) {
272
0
      return NGHTTP2_ERR_REMOVE_HTTP_HEADER;
273
0
    }
274
0
    if (stream->content_length != -1) {
275
0
      return NGHTTP2_ERR_HTTP_HEADER;
276
0
    }
277
0
    stream->content_length = parse_uint(nv->value->base, nv->value->len);
278
0
    if (stream->content_length == -1) {
279
0
      return NGHTTP2_ERR_HTTP_HEADER;
280
0
    }
281
0
    break;
282
0
  }
283
  /* disallowed header fields */
284
0
  case NGHTTP2_TOKEN_CONNECTION:
285
0
  case NGHTTP2_TOKEN_KEEP_ALIVE:
286
0
  case NGHTTP2_TOKEN_PROXY_CONNECTION:
287
0
  case NGHTTP2_TOKEN_TRANSFER_ENCODING:
288
0
  case NGHTTP2_TOKEN_UPGRADE:
289
0
    return NGHTTP2_ERR_HTTP_HEADER;
290
0
  case NGHTTP2_TOKEN_TE:
291
0
    if (!lstrieq("trailers", nv->value->base, nv->value->len)) {
292
0
      return NGHTTP2_ERR_HTTP_HEADER;
293
0
    }
294
0
    break;
295
0
  default:
296
0
    if (nv->name->base[0] == ':') {
297
0
      return NGHTTP2_ERR_HTTP_HEADER;
298
0
    }
299
0
  }
300
301
0
  if (nv->name->base[0] != ':') {
302
0
    stream->http_flags |= NGHTTP2_HTTP_FLAG_PSEUDO_HEADER_DISALLOWED;
303
0
  }
304
305
0
  return 0;
306
0
}
307
308
0
static int check_scheme(const uint8_t *value, size_t len) {
309
0
  const uint8_t *last;
310
0
  if (len == 0) {
311
0
    return 0;
312
0
  }
313
314
0
  if (!(('A' <= *value && *value <= 'Z') || ('a' <= *value && *value <= 'z'))) {
315
0
    return 0;
316
0
  }
317
318
0
  last = value + len;
319
0
  ++value;
320
321
0
  for (; value != last; ++value) {
322
0
    if (!(('A' <= *value && *value <= 'Z') ||
323
0
          ('a' <= *value && *value <= 'z') ||
324
0
          ('0' <= *value && *value <= '9') || *value == '+' || *value == '-' ||
325
0
          *value == '.')) {
326
0
      return 0;
327
0
    }
328
0
  }
329
0
  return 1;
330
0
}
331
332
int nghttp2_http_on_header(nghttp2_session *session, nghttp2_stream *stream,
333
                           nghttp2_frame *frame, nghttp2_hd_nv *nv,
334
0
                           int trailer) {
335
0
  int rv;
336
337
  /* We are strict for pseudo header field.  One bad character should
338
     lead to fail.  OTOH, we should be a bit forgiving for regular
339
     headers, since existing public internet has so much illegal
340
     headers floating around and if we kill the stream because of
341
     this, we may disrupt many web sites and/or libraries.  So we
342
     become conservative here, and just ignore those illegal regular
343
     headers. */
344
0
  if (!nghttp2_check_header_name(nv->name->base, nv->name->len)) {
345
0
    size_t i;
346
0
    if (nv->name->len > 0 && nv->name->base[0] == ':') {
347
0
      return NGHTTP2_ERR_HTTP_HEADER;
348
0
    }
349
    /* header field name must be lower-cased without exception */
350
0
    for (i = 0; i < nv->name->len; ++i) {
351
0
      uint8_t c = nv->name->base[i];
352
0
      if ('A' <= c && c <= 'Z') {
353
0
        return NGHTTP2_ERR_HTTP_HEADER;
354
0
      }
355
0
    }
356
    /* When ignoring regular headers, we set this flag so that we
357
       still enforce header field ordering rule for pseudo header
358
       fields. */
359
0
    stream->http_flags |= NGHTTP2_HTTP_FLAG_PSEUDO_HEADER_DISALLOWED;
360
0
    return NGHTTP2_ERR_IGN_HTTP_HEADER;
361
0
  }
362
363
0
  if (nv->token == NGHTTP2_TOKEN__AUTHORITY ||
364
0
      nv->token == NGHTTP2_TOKEN_HOST) {
365
0
    rv = nghttp2_check_authority(nv->value->base, nv->value->len);
366
0
  } else if (nv->token == NGHTTP2_TOKEN__SCHEME) {
367
0
    rv = check_scheme(nv->value->base, nv->value->len);
368
0
  } else {
369
0
    rv = nghttp2_check_header_value(nv->value->base, nv->value->len);
370
0
  }
371
372
0
  if (rv == 0) {
373
0
    assert(nv->name->len > 0);
374
0
    if (nv->name->base[0] == ':') {
375
0
      return NGHTTP2_ERR_HTTP_HEADER;
376
0
    }
377
    /* When ignoring regular headers, we set this flag so that we
378
       still enforce header field ordering rule for pseudo header
379
       fields. */
380
0
    stream->http_flags |= NGHTTP2_HTTP_FLAG_PSEUDO_HEADER_DISALLOWED;
381
0
    return NGHTTP2_ERR_IGN_HTTP_HEADER;
382
0
  }
383
384
0
  if (session->server || frame->hd.type == NGHTTP2_PUSH_PROMISE) {
385
0
    return http_request_on_header(stream, nv, trailer,
386
0
                                  session->server &&
387
0
                                      session->pending_enable_connect_protocol);
388
0
  }
389
390
0
  return http_response_on_header(stream, nv, trailer);
391
0
}
392
393
int nghttp2_http_on_request_headers(nghttp2_stream *stream,
394
0
                                    nghttp2_frame *frame) {
395
0
  if (!(stream->http_flags & NGHTTP2_HTTP_FLAG__PROTOCOL) &&
396
0
      (stream->http_flags & NGHTTP2_HTTP_FLAG_METH_CONNECT)) {
397
0
    if ((stream->http_flags &
398
0
         (NGHTTP2_HTTP_FLAG__SCHEME | NGHTTP2_HTTP_FLAG__PATH)) ||
399
0
        (stream->http_flags & NGHTTP2_HTTP_FLAG__AUTHORITY) == 0) {
400
0
      return -1;
401
0
    }
402
0
    stream->content_length = -1;
403
0
  } else {
404
0
    if ((stream->http_flags & NGHTTP2_HTTP_FLAG_REQ_HEADERS) !=
405
0
            NGHTTP2_HTTP_FLAG_REQ_HEADERS ||
406
0
        (stream->http_flags &
407
0
         (NGHTTP2_HTTP_FLAG__AUTHORITY | NGHTTP2_HTTP_FLAG_HOST)) == 0) {
408
0
      return -1;
409
0
    }
410
0
    if ((stream->http_flags & NGHTTP2_HTTP_FLAG__PROTOCOL) &&
411
0
        ((stream->http_flags & NGHTTP2_HTTP_FLAG_METH_CONNECT) == 0 ||
412
0
         (stream->http_flags & NGHTTP2_HTTP_FLAG__AUTHORITY) == 0)) {
413
0
      return -1;
414
0
    }
415
0
    if (!check_path(stream)) {
416
0
      return -1;
417
0
    }
418
0
  }
419
420
0
  if (frame->hd.type == NGHTTP2_PUSH_PROMISE) {
421
    /* we are going to reuse data fields for upcoming response.  Clear
422
       them now, except for method flags. */
423
0
    stream->http_flags &= NGHTTP2_HTTP_FLAG_METH_ALL;
424
0
    stream->content_length = -1;
425
0
  }
426
427
0
  return 0;
428
0
}
429
430
0
int nghttp2_http_on_response_headers(nghttp2_stream *stream) {
431
0
  if ((stream->http_flags & NGHTTP2_HTTP_FLAG__STATUS) == 0) {
432
0
    return -1;
433
0
  }
434
435
0
  if (stream->status_code / 100 == 1) {
436
    /* non-final response */
437
0
    stream->http_flags =
438
0
        (uint16_t)((stream->http_flags & NGHTTP2_HTTP_FLAG_METH_ALL) |
439
0
                   NGHTTP2_HTTP_FLAG_EXPECT_FINAL_RESPONSE);
440
0
    stream->content_length = -1;
441
0
    stream->status_code = -1;
442
0
    return 0;
443
0
  }
444
445
0
  stream->http_flags =
446
0
      (uint16_t)(stream->http_flags & ~NGHTTP2_HTTP_FLAG_EXPECT_FINAL_RESPONSE);
447
448
0
  if (!expect_response_body(stream)) {
449
0
    stream->content_length = 0;
450
0
  } else if (stream->http_flags & (NGHTTP2_HTTP_FLAG_METH_CONNECT |
451
0
                                   NGHTTP2_HTTP_FLAG_METH_UPGRADE_WORKAROUND)) {
452
0
    stream->content_length = -1;
453
0
  }
454
455
0
  return 0;
456
0
}
457
458
int nghttp2_http_on_trailer_headers(nghttp2_stream *stream,
459
0
                                    nghttp2_frame *frame) {
460
0
  (void)stream;
461
462
0
  if ((frame->hd.flags & NGHTTP2_FLAG_END_STREAM) == 0) {
463
0
    return -1;
464
0
  }
465
466
0
  return 0;
467
0
}
468
469
0
int nghttp2_http_on_remote_end_stream(nghttp2_stream *stream) {
470
0
  if (stream->http_flags & NGHTTP2_HTTP_FLAG_EXPECT_FINAL_RESPONSE) {
471
0
    return -1;
472
0
  }
473
474
0
  if (stream->content_length != -1 &&
475
0
      stream->content_length != stream->recv_content_length) {
476
0
    return -1;
477
0
  }
478
479
0
  return 0;
480
0
}
481
482
0
int nghttp2_http_on_data_chunk(nghttp2_stream *stream, size_t n) {
483
0
  stream->recv_content_length += (int64_t)n;
484
485
0
  if ((stream->http_flags & NGHTTP2_HTTP_FLAG_EXPECT_FINAL_RESPONSE) ||
486
0
      (stream->content_length != -1 &&
487
0
       stream->recv_content_length > stream->content_length)) {
488
0
    return -1;
489
0
  }
490
491
0
  return 0;
492
0
}
493
494
void nghttp2_http_record_request_method(nghttp2_stream *stream,
495
0
                                        nghttp2_frame *frame) {
496
0
  const nghttp2_nv *nva;
497
0
  size_t nvlen;
498
0
  size_t i;
499
500
0
  switch (frame->hd.type) {
501
0
  case NGHTTP2_HEADERS:
502
0
    nva = frame->headers.nva;
503
0
    nvlen = frame->headers.nvlen;
504
0
    break;
505
0
  case NGHTTP2_PUSH_PROMISE:
506
0
    nva = frame->push_promise.nva;
507
0
    nvlen = frame->push_promise.nvlen;
508
0
    break;
509
0
  default:
510
0
    return;
511
0
  }
512
513
  /* TODO we should do this strictly. */
514
0
  for (i = 0; i < nvlen; ++i) {
515
0
    const nghttp2_nv *nv = &nva[i];
516
0
    if (!(nv->namelen == 7 && nv->name[6] == 'd' &&
517
0
          memcmp(":metho", nv->name, nv->namelen - 1) == 0)) {
518
0
      continue;
519
0
    }
520
0
    if (lstreq("CONNECT", nv->value, nv->valuelen)) {
521
0
      stream->http_flags |= NGHTTP2_HTTP_FLAG_METH_CONNECT;
522
0
      return;
523
0
    }
524
0
    if (lstreq("HEAD", nv->value, nv->valuelen)) {
525
0
      stream->http_flags |= NGHTTP2_HTTP_FLAG_METH_HEAD;
526
0
      return;
527
0
    }
528
0
    return;
529
0
  }
530
0
}