handle empty password for JSON webhook tests, fixes #1168

This commit is contained in:
Matthieu Brouillard
2016-06-30 10:47:41 +02:00
parent 437f944c6e
commit fd1430371a

View File

@@ -119,7 +119,7 @@ trait WebHookService {
}
case WebHookContentType.JSON => {
httpPost.setEntity(EntityBuilder.create().setText(json).build())
if (!webHook.token.isEmpty) {
if (webHook.token.exists(_.trim.nonEmpty)) {
httpPost.addHeader("X-Hub-Signature", XHub.generateHeaderXHubToken(XHubConverter.HEXA_LOWERCASE, XHubDigest.SHA1, webHook.token.orNull, json.getBytes("UTF-8")))
}
}