NEXUS-6249: Fix and UT

Backported to Nexus 2.7.x, original PR
https://github.com/sonatype/nexus-oss/pull/341
Merge pull request #342 from sonatype/nexus-2.7.x-NEXUS-6249-m2-proxy-checksum

[2.7.x] NEXUS-6249: Fix and UT