Specify client in User-agent in our Jira integration.

(imported from commit e436478c6fd2836c06faa90ddb1ca5641d3f61e4)
This commit is contained in:
Luke Faraone 2013-12-06 17:51:16 -05:00
parent c03ac5e3ce
commit e7e90bd60e

View file

@ -103,6 +103,8 @@ class ZulipListener extends AbstractIssueEventListener {
String post(String method, NameValuePair[] parameters) { String post(String method, NameValuePair[] parameters) {
PostMethod post = new PostMethod(zulipUrl(method)) PostMethod post = new PostMethod(zulipUrl(method))
post.setRequestHeader("Content-Type", post.FORM_URL_ENCODED_CONTENT_TYPE) post.setRequestHeader("Content-Type", post.FORM_URL_ENCODED_CONTENT_TYPE)
// TODO: Include more useful data in the User-agent
post.setRequestHeader("User-agent", "ZulipJira/0.1")
try { try {
post.setRequestBody(parameters) post.setRequestBody(parameters)
HttpClient client = new HttpClient() HttpClient client = new HttpClient()
@ -134,7 +136,6 @@ class ZulipListener extends AbstractIssueEventListener {
String sendStreamMessage(String stream, String subject, String message) { String sendStreamMessage(String stream, String subject, String message) {
NameValuePair[] body = [new NameValuePair("api-key", zulipAPIKey), NameValuePair[] body = [new NameValuePair("api-key", zulipAPIKey),
new NameValuePair("email", zulipEmail), new NameValuePair("email", zulipEmail),
new NameValuePair("client", "jira-groovy"),
new NameValuePair("type", "stream"), new NameValuePair("type", "stream"),
new NameValuePair("to", stream), new NameValuePair("to", stream),
new NameValuePair("subject", subject), new NameValuePair("subject", subject),