Commit cf0a9424 authored by 黎博's avatar 黎博

fix error

parent 508fcc7d
......@@ -16,25 +16,35 @@ public class JiraWebhookController {
@PostMapping("/webhook")
public Boolean jiraWebhook(HttpServletRequest request) {
log.info("已进入jira webhook!");
BufferedReader br = null;
String str, wholeStr = "";
// BufferedReader br = null;
// 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 {
br = request.getReader();
while ((str = br.readLine()) != null) {
wholeStr += str;
BufferedReader br = request.getReader();
String str = "";
StringBuilder requestData = new StringBuilder();
while((str = br.readLine()) != null){
requestData.append(str);
}
log.info("jiraWebHook body: {}", wholeStr);
br.close();
} catch (Exception e) {
log.error("jiraWebHook error", e);
} finally {
if (br != null) {
try {
br.close();
} catch (Exception e) {
}
}
e.printStackTrace();
}
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