diff options
| author | Kevin J Hoerr <kjhoerr@protonmail.com> | 2017-07-08 14:37:41 -0400 |
|---|---|---|
| committer | Kevin J Hoerr <kjhoerr@protonmail.com> | 2017-07-08 14:37:41 -0400 |
| commit | 67b14220de0b532e9a6f8746f5e65be02251621e (patch) | |
| tree | 7c5e2a7dd8a4ffca63f190b2de5454d00cec1130 /private/View/Main.php | |
| parent | 4b0a7c07e3de186d93b2a48b50eee2f9ddcec142 (diff) | |
| download | august-offensive-67b14220de0b532e9a6f8746f5e65be02251621e.tar.gz august-offensive-67b14220de0b532e9a6f8746f5e65be02251621e.tar.bz2 august-offensive-67b14220de0b532e9a6f8746f5e65be02251621e.zip | |
Provide callback mechanism
Diffstat (limited to 'private/View/Main.php')
| -rw-r--r-- | private/View/Main.php | 21 |
1 files changed, 16 insertions, 5 deletions
diff --git a/private/View/Main.php b/private/View/Main.php index 746c2bb..b693979 100644 --- a/private/View/Main.php +++ b/private/View/Main.php @@ -19,7 +19,7 @@ class Main private $result; /** @var string TYPE The type of output the client should receive. */ - private const TYPE = "json"; + public const TYPE = "json"; /** * Prepares the output and environment for the front end of the service. @@ -65,10 +65,21 @@ class Main */ public function generateResult (): string { - $this->result = Controller\Controller::createResult( - "", - array() - ); + switch (strtolower($this->query->getPath()[1])) { + case "callback": + $this->result = Controller\Controller::createResult( + "CALLBACK", + array( + "path" => $this->query->getPath(), + "request" => $this->query->getRequest(), + "content" => $this->query->getContent() + ) + ); + break; + default: + $this->result = Controller\Controller::createResult("", array()); + break; + } return self::generateOutput($this->result); } |
