Changeset View
Changeset View
Standalone View
Standalone View
src/aphront/configuration/AphrontDefaultApplicationConfiguration.php
| Show All 19 Lines | public function buildRequest() { | ||||
| // available anyway (according to the PHP documentation, "php://input" is | // available anyway (according to the PHP documentation, "php://input" is | ||||
| // not available for "multipart/form-data" requests). However, it is | // not available for "multipart/form-data" requests). However, it is | ||||
| // available at least some of the time (see T3673), so double check that | // available at least some of the time (see T3673), so double check that | ||||
| // we aren't trying to parse data we won't be able to parse correctly by | // we aren't trying to parse data we won't be able to parse correctly by | ||||
| // examining the Content-Type header. | // examining the Content-Type header. | ||||
| $content_type = idx($_SERVER, 'CONTENT_TYPE'); | $content_type = idx($_SERVER, 'CONTENT_TYPE'); | ||||
| $is_form_data = preg_match('@^multipart/form-data@i', $content_type); | $is_form_data = preg_match('@^multipart/form-data@i', $content_type); | ||||
| $request_method = idx($_SERVER, 'REQUEST_METHOD'); | |||||
| if ($request_method === 'PUT') { | |||||
| // For PUT requests, do nothing: in particular, do NOT read input. This | |||||
| // allows us to stream input later and process very large PUT requests, | |||||
| // like those coming from Git LFS. | |||||
| } else { | |||||
| $raw_input = PhabricatorStartup::getRawInput(); | $raw_input = PhabricatorStartup::getRawInput(); | ||||
| if (strlen($raw_input) && !$is_form_data) { | if (strlen($raw_input) && !$is_form_data) { | ||||
| $data += $parser->parseQueryString($raw_input); | $data += $parser->parseQueryString($raw_input); | ||||
| } else if ($_POST) { | } else if ($_POST) { | ||||
| $data += $_POST; | $data += $_POST; | ||||
| } | } | ||||
| } | |||||
| $data += $parser->parseQueryString(idx($_SERVER, 'QUERY_STRING', '')); | $data += $parser->parseQueryString(idx($_SERVER, 'QUERY_STRING', '')); | ||||
| $cookie_prefix = PhabricatorEnv::getEnvConfig('phabricator.cookie-prefix'); | $cookie_prefix = PhabricatorEnv::getEnvConfig('phabricator.cookie-prefix'); | ||||
| $request = new AphrontRequest($this->getHost(), $this->getPath()); | $request = new AphrontRequest($this->getHost(), $this->getPath()); | ||||
| $request->setRequestData($data); | $request->setRequestData($data); | ||||
| $request->setApplicationConfiguration($this); | $request->setApplicationConfiguration($this); | ||||
| Show All 20 Lines | |||||