Commit e30309961d775fa65f42dbd35387315c30b293a4
1 parent
2276ab36fc
Exists in
master
fix code
Showing 1 changed file with 4 additions and 2 deletions Side-by-side Diff
ServerDocument.md
| ... | ... | @@ -49,7 +49,7 @@ |
| 49 | 49 | * @param request |
| 50 | 50 | * @return |
| 51 | 51 | */ |
| 52 | - public String sig(HttpServletRequest request){ | |
| 52 | + public String sig(HttpServletRequest request, String key){ | |
| 53 | 53 | |
| 54 | 54 | Enumeration names = request.getParameterNames(); |
| 55 | 55 | SortedSet<String> allParams = Sets.newTreeSet(); |
| ... | ... | @@ -66,7 +66,9 @@ |
| 66 | 66 | e.printStackTrace(); |
| 67 | 67 | } |
| 68 | 68 | } |
| 69 | - String computedToken = DigestUtils.md5DigestAsHex(Joiner.on("&").join(allParams).getBytes()); | |
| 69 | + | |
| 70 | + String params = Joiner.on("&").join(allParams)+key; | |
| 71 | + String computedToken = DigestUtils.md5DigestAsHex(params.getBytes()); | |
| 70 | 72 | return computedToken; |
| 71 | 73 | } |
| 72 | 74 | ``` |