[JENKINS-18008] Incorporated Nicolas' https://github.com/jenkinsci/winstone/pull/13

(cherry picked from commit 56052c8452173140c63d5cc15bdd79b510523cc4)