Make middleware work with other versions of Net::HTTP