(int toolFlag, boolean messageIsRequest, IHttpRequestResponse messageInfo)
| 79 | } |
| 80 | |
| 81 | @Override |
| 82 | public void processHttpMessage(int toolFlag, boolean messageIsRequest, IHttpRequestResponse messageInfo) { |
| 83 | if (messageIsRequest) { |
| 84 | IRequestInfo requestInfo = BurpExtender.getHelpers().analyzeRequest(messageInfo); |
| 85 | String origin = this.urlToOrigin(requestInfo.getUrl()); |
| 86 | List<String> headers = requestInfo.getHeaders(); |
| 87 | List<String> cookies = headers.subList(1, headers.size()).stream() |
| 88 | .filter(header -> "cookie".equalsIgnoreCase(header.split(":", 2)[0])) |
| 89 | .collect(Collectors.toList()); |
| 90 | |
| 91 | for (String cookieHeader : cookies) { |
| 92 | String[] temp = cookieHeader.split(":", 2); |
| 93 | if (temp.length != 2) continue; |
| 94 | HashMap<String, String> cookie = this.parseCookie(temp[1]); |
| 95 | if (this.cookies.get(origin) == null) { |
| 96 | this.cookies.put(origin, cookie); |
| 97 | continue; |
| 98 | } |
| 99 | this.cookies.get(origin).putAll(cookie); |
| 100 | } |
| 101 | } |
| 102 | } |
| 103 | |
| 104 | public String getCookieHeader(URL url) { |
| 105 | String origin = this.urlToOrigin(url); |
nothing calls this directly
no test coverage detected