summaryrefslogtreecommitdiff
path: root/html/public/fruitvote/GoPage.php
diff options
context:
space:
mode:
Diffstat (limited to 'html/public/fruitvote/GoPage.php')
-rw-r--r--html/public/fruitvote/GoPage.php18
1 files changed, 16 insertions, 2 deletions
diff --git a/html/public/fruitvote/GoPage.php b/html/public/fruitvote/GoPage.php
index 864c1f7..7e03c35 100644
--- a/html/public/fruitvote/GoPage.php
+++ b/html/public/fruitvote/GoPage.php
@@ -4,7 +4,7 @@ class GoPage {
private $socket;
private $template;
- public function __construct($page, $socket = "/home/simponic/fruitvote/http.sock", $template = "../template.html") {
+ public function __construct($page, $socket = "/home/lizzy/fruitvote/http.sock", $template = "../template.html") {
$this->page = $page;
$this->socket = $socket;
$this->template = $template;
@@ -24,9 +24,23 @@ class GoPage {
curl_setopt($ch, CURLOPT_UNIX_SOCKET_PATH, $this->socket);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
+ // forward query params
+ $query = $_SERVER['QUERY_STRING'];
+ if ($query) {
+ curl_setopt($ch, CURLOPT_URL, $url."?".$query);
+ }
+
+ //forward post data
+ if ($_SERVER['REQUEST_METHOD'] === 'POST') {
+ curl_setopt($ch, CURLOPT_POST, 1);
+ curl_setopt($ch, CURLOPT_POSTFIELDS, file_get_contents('php://input'));
+ }
+
+
$output = curl_exec($ch);
curl_close($ch);
- // todo: get headers / cookies, forward back response
+
+
return $output;
}