[13.x] Add QUERY route method support
Merged
JO
19d ago+106+106+012345678901234567890123456789-5-5-0123456789
Backports Route::query() from #60655 to 13.x.
Route::query('/products/search', SearchProductsController::class);
#60650 was redirected to master because it modified the Registrar contract. This version leaves the contract untouched, so there's no BC break for implementors. The query() / queryJson() testing helpers are already on 13.x (#60662).
Differences from #60655
- No
Registrarcontract change. - QUERY stays CSRF-verified. #60655 adds
QUERYtoPreventRequestForgery::isReading(). QUERY is safe by spec, but the route handler is app code carrying a request body, and nothing guarantees it's side-effect free. Browsers do preflight cross-origin QUERY, but that only protects apps whose CORS config is strict; an app allowing credentialed requests from broad origins would expose everywebQUERY route. Verifying it like other body-carrying methods keeps CSRF independent of CORS config. Apps can opt out per route withpreventRequestForgery(except: [...]).