Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Certificate的构造类里面有bug #7

Closed
delonzhou opened this issue Jul 6, 2018 · 1 comment
Closed

Certificate的构造类里面有bug #7

delonzhou opened this issue Jul 6, 2018 · 1 comment

Comments

@delonzhou
Copy link

版本:1.1.1

  1. 下面的request的header key "signature"首字母应为大写的
  2. 下面的request的header key "signaturecerturl"首字母应为大写的
  3. 获取上述两个key的逻辑应该是不对,感觉是乱写的

public Certificate(HttpServletRequest request) {
try {
Map<String, String> map = new HashMap();
Enumeration headernames = request.getHeaderNames();

        String signature;
        String signaturecerturl;
        while(headernames.hasMoreElements()) {
            signature = (String)headernames.nextElement();
            signaturecerturl = request.getHeader(signature);
            map.put(signature, signaturecerturl);
        }

        signature = (String)map.get("signature");
        signaturecerturl = (String)map.get("signaturecerturl");
        BufferedReader bufferedReader = new BufferedReader(new InputStreamReader(request.getInputStream(), "utf-8"));
        StringBuffer stringBuffer = new StringBuffer("");
        String temp = "";

        while((temp = bufferedReader.readLine()) != null) {
            stringBuffer.append(temp);
        }

        String message = stringBuffer.toString();
        this.signature = signature;
        this.signaturecerturl = signaturecerturl;
        this.message = message;
    } catch (IOException var10) {
        ;
    }

}
@longger
Copy link
Contributor

longger commented Jul 6, 2018

HTTP协议的Header的key是大小写不敏感的

@longger longger closed this as completed Dec 27, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants