@@ -98,7 +98,7 @@ protected function makeClient(?\Swlib\Http\Uri $uri = null): self {
98
98
$ client = \Swlib \SaberGM::psr ([
99
99
'use_pool ' => static ::USE_POOL ,
100
100
'method ' => static ::METHOD ,
101
- 'useragent ' => 'MangoHttpClient/3.0.0 (CentOS 7; Cor) ' ,
101
+ 'useragent ' => 'Swango/1.2 ' ,
102
102
'timeout ' => static ::TIMEOUT ,
103
103
'keep_alive ' => static ::KEEP_ALIVE ,
104
104
'uri ' => $ uri ,
@@ -216,7 +216,8 @@ protected function parseRequest(&$post, &$get, &$header, ?string $request_string
216
216
$ swoole_request = \Swango \HttpServer \Controller::getInstance ()->getSwooleHttpRequest ();
217
217
if (\Swango \HttpServer \Router::getInstance ()->getMethod () === 'POST ' ) {
218
218
if (static ::PARSE_POST === self ::PARSE_MODE_URL_ENCODE_KV ) {
219
- $ post = $ swoole_request ->post ;
219
+ $ post = null ;
220
+ parse_str ($ swoole_request ->rawContent (), $ post );
220
221
} elseif (static ::PARSE_POST === self ::PARSE_MODE_JSON ) {
221
222
$ post = \Json::decodeAsArray ($ swoole_request ->rawContent ());
222
223
} else {
@@ -240,7 +241,7 @@ protected function parseRequest(&$post, &$get, &$header, ?string $request_string
240
241
}
241
242
unset($ value );
242
243
$ log_string = date ('[Y-m-d H:i:s] ' , \Time \now ()) . "----------Webhook---------- \n" ;
243
- $ log_string .= $ swoole_request ->getData () . "\n" ;
244
+ $ log_string .= $ swoole_request ->getData () . "\n\n " ;
244
245
$ this ->writeLog ($ log_string );
245
246
} else {
246
247
if (! isset ($ request_string )) {
@@ -312,4 +313,4 @@ public static function parseRequestString(string $string): Swlib\Http\Request {
312
313
}
313
314
return $ request ;
314
315
}
315
- }
316
+ }
0 commit comments