We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Please answer these questions before submitting your issue. Thanks!
当我想强制不使用 compress 时,即便 header 内客户端提供了 Accept-Encoding ,因为我配置了 'http_compression' => false 都应该不执行压缩。这个在做微服务代理处理的时候我们需要关闭自动压缩。
'http_compression' => false
<?php function run($func) { $scheduler = new \Swoole\Coroutine\Scheduler; $scheduler->set([ 'hook_flags' => SWOOLE_HOOK_ALL, ]); $scheduler->add(function () use ($func) { call_user_func($func); }); $scheduler->start(); } run(function(){ $server = new \Swoole\Coroutine\Http\Server('0.0.0.0',9999); $server->set([ 'http_compression' => false, ]); $server->handle('/', function ($requ, $resp) { $resp->end('hello'); }); go(function() use ($server) { $server->start(); }); $cli = new \Swoole\Coroutine\Http\Client('127.0.0.1', 9999); $cli->get('/'); var_dump($cli->getHeaders()); });
array(6) { ["server"]=> string(18) "swoole-http-server" ["connection"]=> string(10) "keep-alive" ["content-type"]=> string(9) "text/html" ["date"]=> string(29) "Sun, 19 Apr 2020 15:02:20 GMT" ["content-length"]=> string(2) "25" ["content-encoding"]=> string(4) "gzip" }
What did you expect to see?
What did you see instead?
What version of Swoole are you using (show your php --ri swoole)?
php --ri swoole
swoole Swoole => enabled Author => Swoole Team <[email protected]> Version => 4.4.17 Built => Apr 10 2020 18:30:47 coroutine => enabled kqueue => enabled rwlock => enabled openssl => OpenSSL 1.1.1d 10 Sep 2019 http2 => enabled pcre => enabled zlib => 1.2.11 async_redis => enabled Directive => Local Value => Master Value swoole.enable_coroutine => On => On swoole.enable_library => On => On swoole.enable_preemptive_scheduler => Off => Off swoole.display_errors => On => On swoole.use_shortname => On => On swoole.unixsock_buffer_size => 262144 => 262144
The text was updated successfully, but these errors were encountered:
Fixed via #3257
Sorry, something went wrong.
Successfully merging a pull request may close this issue.
Please answer these questions before submitting your issue. Thanks!
当我想强制不使用 compress 时,即便 header 内客户端提供了 Accept-Encoding ,因为我配置了
'http_compression' => false
都应该不执行压缩。这个在做微服务代理处理的时候我们需要关闭自动压缩。What did you expect to see?
What did you see instead?
What version of Swoole are you using (show your
php --ri swoole
)?The text was updated successfully, but these errors were encountered: