MacBook Safari Download - Connection Lost when Changing Power Source
I'm running a MacBook Pro (Retina, 15-inch, Late 2013) on macOS Sierra (10.12.3). Safari Version 10.0.3 (12602.4.8).
I often find myself downloading somewhat large files using safari (1-2 GB per file). I've recently noticed that while downloading, if I change from battery to charger power, or from charger to battery, the download immediately stops and says "The network connection was lost". I'm using a WiFi connection when this happens, but wireless does not disconnect or stop working during this time. Only the download seems to be affected. When I press the orange restart button, the download starts right back up again, but annoying when I am downloading in the background and forget to restart when I plug in. What could be causing this?
MacBook Pro (Retina, 15-inch, Late 2013), macOS Sierra (10.12.3)