mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2024-11-15 03:18:26 +00:00
Add setInput function to CakeRequest
Modify data originally from `php://input`. Useful for altering json/xml data in middleware or DispatcherFilters before it gets to RequestHandlerComponent or other controllers.
This commit is contained in:
parent
6bacc5bb46
commit
6bf0b22195
1 changed files with 11 additions and 0 deletions
|
@ -915,6 +915,17 @@ class CakeRequest implements ArrayAccess {
|
|||
return $input;
|
||||
}
|
||||
|
||||
/**
|
||||
* Modify data originally from `php://input`. Useful for altering json/xml data
|
||||
* in middleware or DispatcherFilters before it gets to RequestHandlerComponent
|
||||
*
|
||||
* @param string $input A string to replace original parsed data from input()
|
||||
* @return void
|
||||
*/
|
||||
public function setInput($input) {
|
||||
$this->_input = $input;
|
||||
}
|
||||
|
||||
/**
|
||||
* Allow only certain HTTP request methods. If the request method does not match
|
||||
* a 405 error will be shown and the required "Allow" response header will be set.
|
||||
|
|
Loading…
Reference in a new issue