Merge pull request #1224 from McFoggy/issue-1168-json

handle empty password for JSON webhook tests, fixes #1168
This commit is contained in:
Matthieu Brouillard
2016-06-30 13:30:58 +02:00
committed by GitHub

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")))
}
}