Repository navigation
Commit 6bc7314
committed
fix(auth): reject non-preflight OPTIONS on body-reading routes
CORSMiddleware only answers *preflight* OPTIONS requests (those carrying
Access-Control-Request-Method); any other OPTIONS request is forwarded to the
wrapped handler, which then tries to read a body and fails with a 400/500.
/token, /register and /revoke only accept POST, so a plain OPTIONS should get
a 405 instead of being routed into the body-reading handler.
Add _reject_non_preflight_options between the CORS layer and the body reader,
and drop OPTIONS from the 413 parametrization (OPTIONS no longer reaches the
body reader).
Fixes #36521 parent 06d1d1e commit 6bc7314
2 files changed
Lines changed: 70 additions & 7 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
7 | 7 | | |
8 | 8 | | |
9 | 9 | | |
10 | | - | |
| 10 | + | |
11 | 11 | | |
12 | 12 | | |
13 | 13 | | |
| |||
61 | 61 | | |
62 | 62 | | |
63 | 63 | | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
64 | 98 | | |
65 | 99 | | |
66 | 100 | | |
| |||
117 | 151 | | |
118 | 152 | | |
119 | 153 | | |
120 | | - | |
| 154 | + | |
121 | 155 | | |
122 | 156 | | |
123 | 157 | | |
| |||
130 | 164 | | |
131 | 165 | | |
132 | 166 | | |
133 | | - | |
| 167 | + | |
134 | 168 | | |
135 | 169 | | |
136 | 170 | | |
| |||
140 | 174 | | |
141 | 175 | | |
142 | 176 | | |
143 | | - | |
| 177 | + | |
144 | 178 | | |
145 | 179 | | |
146 | 180 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
303 | 303 | | |
304 | 304 | | |
305 | 305 | | |
306 | | - | |
307 | | - | |
308 | | - | |
309 | 306 | | |
310 | 307 | | |
311 | 308 | | |
| |||
347 | 344 | | |
348 | 345 | | |
349 | 346 | | |
| 347 | + | |
| 348 | + | |
| 349 | + | |
| 350 | + | |
| 351 | + | |
| 352 | + | |
| 353 | + | |
| 354 | + | |
| 355 | + | |
| 356 | + | |
| 357 | + | |
| 358 | + | |
| 359 | + | |
| 360 | + | |
| 361 | + | |
| 362 | + | |
| 363 | + | |
| 364 | + | |
| 365 | + | |
| 366 | + | |
| 367 | + | |
| 368 | + | |
| 369 | + | |
| 370 | + | |
| 371 | + | |
| 372 | + | |
| 373 | + | |
| 374 | + | |
| 375 | + | |
| 376 | + | |
| 377 | + | |
| 378 | + | |
0 commit comments