Commit eeb8fbf
committed
REST API: Return a more appropriate HTTP 400 response code when attempting to create or update a non-existent setting.
This switches the response from a 200, which is not appropriate for invalid requests.
Props sheldorofazeroth, johnbillion
Fixes #41604
git-svn-id: https://develop.svn.wordpress.org/trunk@60301 602fd350-edb4-49c9-b593-d223f7449a821 parent 1f9d279 commit eeb8fbf
File tree
2 files changed
+42
-2
lines changed- src/wp-includes/rest-api/endpoints
- tests/phpunit/tests/rest-api
2 files changed
+42
-2
lines changedLines changed: 12 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
147 | 147 | | |
148 | 148 | | |
149 | 149 | | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
150 | 162 | | |
151 | 163 | | |
152 | 164 | | |
| |||
Lines changed: 30 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
385 | 385 | | |
386 | 386 | | |
387 | 387 | | |
388 | | - | |
| 388 | + | |
389 | 389 | | |
390 | 390 | | |
391 | | - | |
| 391 | + | |
| 392 | + | |
| 393 | + | |
| 394 | + | |
| 395 | + | |
| 396 | + | |
| 397 | + | |
392 | 398 | | |
393 | 399 | | |
394 | 400 | | |
395 | 401 | | |
| 402 | + | |
396 | 403 | | |
397 | 404 | | |
398 | 405 | | |
| |||
403 | 410 | | |
404 | 411 | | |
405 | 412 | | |
| 413 | + | |
| 414 | + | |
| 415 | + | |
| 416 | + | |
| 417 | + | |
| 418 | + | |
| 419 | + | |
| 420 | + | |
| 421 | + | |
| 422 | + | |
| 423 | + | |
| 424 | + | |
| 425 | + | |
| 426 | + | |
| 427 | + | |
| 428 | + | |
| 429 | + | |
| 430 | + | |
| 431 | + | |
| 432 | + | |
| 433 | + | |
406 | 434 | | |
407 | 435 | | |
408 | 436 | | |
| |||
0 commit comments