Sometimes when I run composer update to upgrade the laravel project, a content-length mismatch exception might occur. Finally, I get this is because of the terrible firewall
Just change the composer default repo url:
composer config -g repo.packagist composer https://packagist.org
composer config -g github-protocols https ssh
It changes or sets the packagist repo to be used by https only.
This fixes any issues with local composer.json files too. No need to mess around with the composer.json file localy or global.