Commit cf0a9424 authored by 黎博's avatar 黎博

fix error

parent 508fcc7d
...@@ -16,25 +16,35 @@ public class JiraWebhookController { ...@@ -16,25 +16,35 @@ public class JiraWebhookController {
@PostMapping("/webhook") @PostMapping("/webhook")
public Boolean jiraWebhook(HttpServletRequest request) { public Boolean jiraWebhook(HttpServletRequest request) {
log.info("已进入jira webhook!"); log.info("已进入jira webhook!");
BufferedReader br = null; // BufferedReader br = null;
String str, wholeStr = ""; // String str, wholeStr = "";
// try {
// br = request.getReader();
// while ((str = br.readLine()) != null) {
// wholeStr += str;
// }
// log.info("jiraWebHook body: {}", wholeStr);
// } catch (Exception e) {
// log.error("jiraWebHook error", e);
// } finally {
// if (br != null) {
// try {
// br.close();
// } catch (Exception e) {
// }
// }
// }
try { try {
br = request.getReader(); BufferedReader br = request.getReader();
String str = "";
while ((str = br.readLine()) != null) { StringBuilder requestData = new StringBuilder();
wholeStr += str; while((str = br.readLine()) != null){
requestData.append(str);
} }
log.info("jiraWebHook body: {}", wholeStr); br.close();
} catch (Exception e) { } catch (Exception e) {
log.error("jiraWebHook error", e); e.printStackTrace();
} finally {
if (br != null) {
try {
br.close();
} catch (Exception e) {
}
}
} }
return true; return false;
} }
} }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment