收藏
回答

接收component_verify_ticket时,偶尔会发生读取数据错误是什么原因?

@RequestMapping(value = "/getComponentVerifyTicket")
public String getComponentVerifyTicket(HttpServletRequest request, HttpServletResponse response) throws Exception {
    log.info("接收component_verify_ticket 或 authorized事件");
    String nonce = request.getParameter("nonce");
    String timestamp = request.getParameter("timestamp");
    String msgSignature = request.getParameter("msg_signature");
    StringBuilder sb = new StringBuilder();
    BufferedReader in = request.getReader();
    String line;
    while ((line = in.readLine()) != null) {
        sb.append(line);
    }
    String postData = sb.toString();
    log.info("nonce: " + nonce);
    log.info("timestamp: " + timestamp);
    log.info("msgSignature: " + msgSignature);
    log.info("postData: " + postData);
    authService.handleAuthEvent(timestamp, nonce, msgSignature,postData);
    return "success";
}


获取的postData偶尔会为 [Fatal Error] :-1:-1: Premature end of file.

请问这是什么原因?代码一直没有修改过,但是每天都会有几次接收到的请求是这样的,从而导致数据报错

回答关注问题邀请回答
收藏
登录 后发表内容