Changeset View
Changeset View
Standalone View
Standalone View
src/aphront/configuration/AphrontApplicationConfiguration.php
| Show First 20 Lines • Show All 765 Lines • ▼ Show 20 Lines | private static function newSelfCheckResponse() { | ||||
| $params = array(); | $params = array(); | ||||
| foreach ($pairs as $v) { | foreach ($pairs as $v) { | ||||
| $params[] = array( | $params[] = array( | ||||
| 'name' => $v[0], | 'name' => $v[0], | ||||
| 'value' => $v[1], | 'value' => $v[1], | ||||
| ); | ); | ||||
| } | } | ||||
| $raw_input = @file_get_contents('php://input'); | |||||
| if ($raw_input !== false) { | |||||
| $base64_input = base64_encode($raw_input); | |||||
| } else { | |||||
| $base64_input = null; | |||||
| } | |||||
| $result = array( | $result = array( | ||||
| 'path' => $path, | 'path' => $path, | ||||
| 'params' => $params, | 'params' => $params, | ||||
| 'user' => idx($_SERVER, 'PHP_AUTH_USER'), | 'user' => idx($_SERVER, 'PHP_AUTH_USER'), | ||||
| 'pass' => idx($_SERVER, 'PHP_AUTH_PW'), | 'pass' => idx($_SERVER, 'PHP_AUTH_PW'), | ||||
| 'raw.base64' => $base64_input, | |||||
| // This just makes sure that the response compresses well, so reasonable | // This just makes sure that the response compresses well, so reasonable | ||||
| // algorithms should want to gzip or deflate it. | // algorithms should want to gzip or deflate it. | ||||
| 'filler' => str_repeat('Q', 1024 * 16), | 'filler' => str_repeat('Q', 1024 * 16), | ||||
| ); | ); | ||||
| return id(new AphrontJSONResponse()) | return id(new AphrontJSONResponse()) | ||||
| ->setAddJSONShield(false) | ->setAddJSONShield(false) | ||||
| ->setContent($result); | ->setContent($result); | ||||
| ▲ Show 20 Lines • Show All 87 Lines • Show Last 20 Lines | |||||