Commit 5f5829d
committed
fix(nginx,h2o): reject unknown HTTP methods with 405
Both nginx module and h2o were accepting any HTTP method (GETT, FOOBAR, etc.)
and returning 200, failing the validate.sh bad method check.
nginx changes:
- Add method guard at top of handler: only GET/HEAD/POST allowed, else 405
- Change fallthrough from NGX_DECLINED to 404 so unknown paths don't leak
to nginx's default handler
h2o changes:
- Add reject_bad_method() helper checking for GET/HEAD/POST
- Guard all route handlers (pipeline, baseline11, baseline2, json, static,
compression, db) — upload already checks for POST
Both now return 405 Method Not Allowed for unknown methods.
Fixes validate.sh bad method test for nginx and h2o.1 parent b675210 commit 5f5829d
2 files changed
Lines changed: 41 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
57 | 57 | | |
58 | 58 | | |
59 | 59 | | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
60 | 81 | | |
61 | 82 | | |
62 | 83 | | |
63 | 84 | | |
64 | 85 | | |
| 86 | + | |
65 | 87 | | |
66 | 88 | | |
67 | 89 | | |
| |||
78 | 100 | | |
79 | 101 | | |
80 | 102 | | |
| 103 | + | |
81 | 104 | | |
82 | 105 | | |
83 | 106 | | |
| |||
107 | 130 | | |
108 | 131 | | |
109 | 132 | | |
| 133 | + | |
110 | 134 | | |
111 | 135 | | |
112 | 136 | | |
| |||
127 | 151 | | |
128 | 152 | | |
129 | 153 | | |
| 154 | + | |
130 | 155 | | |
131 | 156 | | |
132 | 157 | | |
| |||
246 | 271 | | |
247 | 272 | | |
248 | 273 | | |
| 274 | + | |
249 | 275 | | |
250 | 276 | | |
251 | 277 | | |
| |||
302 | 328 | | |
303 | 329 | | |
304 | 330 | | |
| 331 | + | |
305 | 332 | | |
306 | 333 | | |
307 | 334 | | |
| |||
352 | 379 | | |
353 | 380 | | |
354 | 381 | | |
| 382 | + | |
355 | 383 | | |
356 | 384 | | |
357 | 385 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
317 | 317 | | |
318 | 318 | | |
319 | 319 | | |
| 320 | + | |
| 321 | + | |
| 322 | + | |
| 323 | + | |
| 324 | + | |
| 325 | + | |
| 326 | + | |
| 327 | + | |
320 | 328 | | |
321 | 329 | | |
322 | 330 | | |
| |||
435 | 443 | | |
436 | 444 | | |
437 | 445 | | |
438 | | - | |
| 446 | + | |
| 447 | + | |
| 448 | + | |
| 449 | + | |
| 450 | + | |
439 | 451 | | |
440 | 452 | | |
441 | 453 | | |
| |||
0 commit comments