File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -62,9 +62,13 @@ private function initCurl(){
6262
6363 private function sendRequest (){
6464 $ method = $ _SERVER ['REQUEST_METHOD ' ] ?? 'GET ' ;
65+ $ method = 'GET ' ;
66+
6567 $ this ->log ('HTTP Request: ' . $ method );
6668
67- if ($ method == 'POST ' ){
69+ $ this ->log ('HTTP Request2: ' . file_get_contents ('php://input ' ));
70+
71+ if ($ method == 'POST ' || file_get_contents ('php://input ' )!='' || sizeof ($ _POST )>0 ){
6872 curl_setopt ($ this ->ch , CURLOPT_POST , true );
6973
7074 if (sizeof ($ _FILES ) > 0 ){
@@ -82,7 +86,8 @@ private function sendRequest(){
8286 $ ct = $ _SERVER ['HTTP_CONTENT_TYPE ' ] ?? $ _SERVER ['CONTENT_TYPE ' ];
8387 curl_setopt ($ this ->ch , CURLOPT_HTTPHEADER , ['Content-type: ' . $ ct ]);
8488 }
85-
89+
90+ $ this ->log ('Send To Telegram HTTP Request body: ' . json_encode ($ post ,JSON_UNESCAPED_UNICODE ));
8691 curl_setopt ($ this ->ch , CURLOPT_POSTFIELDS , $ post );
8792 $ this ->log ('Send data: ' . var_export ($ post , true ));
8893
@@ -93,6 +98,6 @@ private function sendRequest(){
9398}
9499
95100$ proxy = new TelegramApiProxy ;
96- $ proxy ->setLog (true ); // use logs only for debug
101+ $ proxy ->setLog (false ); // use logs only for debug
97102$ proxy ->start ();
98- ?>
103+ ?>
You can’t perform that action at this time.
0 commit comments