PHP Composer - Downloading Repository Times Out on Update/Install

I was having problems getting composer install to  run. It kept hanging on "Loading repositories with package information." I tried to download the package list manually using wget as a test, and it hung as well:

 $ wget
 --2019-01-13 13:04:50--
 Resolving ( 2607:5300:201:2100::7:2273,
 Connecting to (|2607:5300:201:2100::7:2273|:443... 

The issue has to do with the routing for the IPv6 address of being broken, as noted in this GitHub issue.

I tried disabling IPv6 in Fedora's Network Manager, but for some reason, I was still getting an IPv6 address on the interface. I solved this problem using a temporary method suggested in the comments of the issue above by manually adding the IPv4 address of to the hosts file on my machine:

# dig +short
# echo "" >> /etc/hosts