skipped 12 lines 13 13 14 14 package com.nccgroup.loggerplusplus.logentry; 15 15 16 - import burp.*; 16 + import burp.api.montoya.core.ToolType; 17 + import burp.api.montoya.http.HttpService; 18 + import burp.api.montoya.http.MimeType; 19 + import burp.api.montoya.http.message.cookies.Cookie; 20 + import burp.api.montoya.http.message.headers.HttpHeader; 21 + import burp.api.montoya.http.message.params.HttpParameter; 22 + import burp.api.montoya.http.message.params.HttpParameterType; 23 + import burp.api.montoya.http.message.requests.HttpRequest; 24 + import burp.api.montoya.http.message.responses.HttpResponse; 17 25 import com.nccgroup.loggerplusplus.LoggerPlusPlus; 18 26 import com.nccgroup.loggerplusplus.filter.colorfilter.ColorFilter; 19 27 import com.nccgroup.loggerplusplus.filter.tag.Tag; 20 28 import com.nccgroup.loggerplusplus.logview.processor.LogProcessor; 21 - import com.nccgroup.loggerplusplus.logview.processor.LogProcessorHelper; 22 29 import com.nccgroup.loggerplusplus.reflection.ReflectionController; 23 30 import com.nccgroup.loggerplusplus.util.Globals; 24 31 import lombok.AccessLevel; skipped 2 lines 27 34 import org.apache.commons.codec.digest.DigestUtils; 28 35 import org.apache.commons.lang3.StringUtils; 29 36 37 + import java.net.MalformedURLException; 30 38 import java.net.URL; 31 - import java.nio.charset.StandardCharsets; 32 39 import java.text.ParseException; 33 40 import java.util.*; 34 41 import java.util.regex.Matcher; skipped 6 lines 41 48 Status previousStatus; 42 49 Status status = Status.UNPROCESSED; 43 50 44 - @Getter (AccessLevel.NONE) 51 + @Setter (AccessLevel.NONE) 52 + private HttpRequest request; 45 53 @Setter(AccessLevel.NONE) 46 - private IHttpRequestResponse requestResponse; //Only used for request, comment and HTTP Service. 47 - private byte[] response; 54 + private HttpResponse response; 48 55 49 56 private Integer identifier; 50 - private int tool; 51 - private String toolName; 57 + private ToolType tool; 52 58 private String hostname = ""; 53 59 private String host = ""; // TODO better name? 54 60 private String method = ""; 61 + private String urlString; 55 62 private URL url; 56 63 private boolean params = false; 57 64 private Short responseStatus = -1; skipped 2 lines 60 67 private boolean hasBodyParam = false; 61 68 private boolean hasCookieParam = false; 62 69 private String title = ""; 63 - private String newCookies = " " ; 70 + private String comment ; 71 + private List<String> newCookies = new ArrayList<>(); 64 72 private String sentCookies = ""; 65 73 private String listenerInterface = ""; 66 74 private boolean isSSL = false; skipped 7 lines 74 82 private String clientIP = ""; 75 83 private boolean hasSetCookies = false; 76 84 private String formattedResponseTime = ""; 77 - private String responseMimeType = " " ; 78 - private String responseInferredMimeType = " " ; 85 + private MimeType responseMimeType; 86 + private MimeType responseInferredMimeType; 79 87 private int responseBodyLength = -1; 80 88 private String responseContentType = ""; 81 89 private boolean complete = false; skipped 10 lines 92 100 private Date responseDateTime = new Date(0); //Zero epoch dates to prevent null. Response date pulled from response headers 93 101 private Date requestDateTime = new Date(0); //Zero epoch dates to prevent null. Response date pulled from response headers 94 102 private int requestResponseDelay = -1; 95 - private List<String > responseHeaders; 96 - private List<String > requestHeaders; 97 - private List<IParameter> tempParameters; 103 + private List<HttpHeader > responseHeaders; 104 + private List<HttpHeader > requestHeaders; 98 105 private List<String> parameters; 99 106 private List<String> reflectedParameters; 100 107 101 108 private LogEntry() { 102 - this.matchingColorFilters = Collections.synchronizedList(new ArrayList<UUID >()); 103 - this.matchingTags = Collections.synchronizedList(new ArrayList<Tag >()); 109 + this.matchingColorFilters = Collections.synchronizedList(new ArrayList<>()); 110 + this.matchingTags = Collections.synchronizedList(new ArrayList<>()); 104 111 } 105 112 106 - public LogEntry(int tool, IHttpRequestResponse requestResponse) { 113 + public LogEntry(ToolType tool, HttpRequest request) { 107 114 this(); 108 115 this.tool = tool; 109 - this.toolName = LoggerPlusPlus.callbacks.getToolName(tool); 110 - this.requestResponse = requestResponse; 111 - this.response = requestResponse.getResponse(); 116 + this.request = request; 117 + } 118 + 119 + public LogEntry(ToolType tool, HttpRequest request, HttpResponse response){ 120 + this(tool, request); 121 + this.response = response; 112 122 } 113 123 114 124 /** 115 125 * Create new entry and specify arrival time. 116 126 * 117 127 * @param tool 128 + * @param request 118 129 * @param formattedRequestTime 119 - * @param requestResponse 120 130 */ 121 - public LogEntry(int tool, Date formattedRequestTime, IHttpRequestResponse requestResponse) { 122 - this(tool, requestResponse ); 131 + public LogEntry(ToolType tool, HttpRequest request, Date formattedRequestTime) { 132 + this(tool, request ); 123 133 this.setReqestTime(formattedRequestTime); 124 134 } 125 135 126 - public void process() { 127 - // TODO Move into separate processing class 136 + public boolean process() { 128 137 previousStatus = this.status; 129 138 switch (this.status) { 130 139 case UNPROCESSED: { 131 140 this.status = processRequest(); 132 - // If the entry should be ignored, break here. 141 + // If the entry should be ignored, stop here. 133 142 if (this.status == Status.IGNORED) 134 - break; 143 + return true; 135 144 136 145 // Else continue, fall through to process response 137 146 } 138 147 case AWAITING_RESPONSE: { 139 148 if (this.response == null) { 140 149 this.status = Status.AWAITING_RESPONSE; 141 - break; 150 + return false; 142 151 } 143 152 processResponse(); 144 153 this.status = Status.PROCESSED; 154 + return true; 145 155 } 146 156 147 157 case IGNORED: 148 158 case PROCESSED: { 149 159 // Nothing to do, we're done! 150 - break; 160 + return true; 151 161 } 162 + 163 + default: return false; 152 164 } 153 165 } 154 166 skipped 11 lines 166 178 } 167 179 168 180 private Status processRequest() { 169 - IRequestInfo tempAnalyzedReq = LoggerPlusPlus.callbacks.getHelpers().analyzeRequest(this.requestResponse); 170 - URL uUrl = tempAnalyzedReq.getUrl(); 171 - if (!LoggerPlusPlus.isUrlInScope(uUrl)) 172 - return Status.IGNORED; 181 + 173 182 174 - requestHeaders = tempAnalyzedReq.getHeaders(); 183 + requestHeaders = request.headers(); 175 184 176 185 // Get HTTP Version, which would be the last token in "GET /admin/login/?next\u003d/admin/ HTTP/1.1" 177 - String[] httpRequestTokens = requestHeaders.get(0).split(" "); 186 + String[] httpRequestTokens = requestHeaders.get(0).value ( ) . split(" "); 178 187 this.requestHttpVersion = httpRequestTokens[httpRequestTokens.length - 1]; 179 188 180 - this.tempParameters = tempAnalyzedReq.getParameters().stream() 181 - .filter(iParameter -> iParameter.getType() != IParameter.PARAM_COOKIE).collect(Collectors.toList()); 182 - this.parameters = tempParameters.stream().map(IParameter::getName).collect(Collectors.toList()); 189 + this.parameters = request.parameters().stream() 190 + .filter(param -> param.type() != HttpParameterType.COOKIE) 191 + .map(HttpParameter::name) 192 + .collect(Collectors.toList()); 183 193 184 - this.url = tempAnalyzedReq.getUrl(); 185 - this.hostname = this.requestResponse.getHttpService().getHost(); 186 - this.protocol = this.requestResponse.getHttpService().getProtocol(); 187 - this.isSSL = this.protocol.equals("https"); 188 - this.targetPort = this.requestResponse.getHttpService().getPort(); 194 + this.urlString = request.url(); 195 + this.hostname = this.request.httpService().host(); 196 + this.protocol = this.request.httpService().secure() ? "https" : "http"; 197 + this.isSSL = this.request.httpService().secure(); 198 + this.targetPort = this.request.httpService().port(); 189 199 190 200 boolean isDefaultPort = (this.protocol.equals("https") && this.targetPort == 443) 191 201 || (this.protocol.equals("http") && this.targetPort == 80); 192 202 193 203 this.host = this.protocol + "://" + this.hostname + (isDefaultPort ? "" : ":" + this.targetPort); 194 204 195 - this.method = tempAnalyzedReq.getMethod(); 205 + this.method = request.method(); 206 + this.requestBodyLength = this.getRequestBytes().length - request.bodyOffset(); 207 + this.hasBodyParam = requestBodyLength > 0; 208 + 196 209 try { 210 + this.url = new URL(request.url()); 211 + 197 212 // I don't want to delete special characters such as ; or : from the extension 198 213 // as it may really be part of the extension! (burp proxy log ignores them) 199 - String tempPath = this . url.getPath().replaceAll("\\\\", "/"); 214 + String tempPath = url.getPath().replaceAll("\\\\", "/"); 200 215 tempPath = tempPath.substring(tempPath.lastIndexOf("/")); 201 216 int tempPathDotLocation = tempPath.lastIndexOf("."); 202 - if (tempPathDotLocation >= 0) 217 + if (tempPathDotLocation >= 0) { 203 218 this.urlExtension = tempPath.substring(tempPathDotLocation + 1); 204 - } catch (Exception e) { 205 - this.urlExtension = ""; 206 - } 219 + } 220 + this.params = url.getQuery() != null || this.hasBodyParam; 221 + } catch (MalformedURLException ignored) {} 207 222 208 - this.requestBodyLength = this.getRequest().length - tempAnalyzedReq.getBodyOffset(); 209 - this.hasBodyParam = requestBodyLength > 0; 210 - this.params = this.url.getQuery() != null || this.hasBodyParam; 211 - this.hasCookieParam = false; 223 + 224 + 212 225 213 226 // reading request headers like a boss! 214 - for (String item : requestHeaders) { 215 - if (item .contains(":")) { 216 - String[] headerItem = item.split(":\\s", 2); 217 - if (headerItem[0].equalsIgnoreCase("cookie")) { 218 - this.sentCookies = headerItem[1]; 227 + for (HttpHeader header : requestHeaders) { 228 + / / if (header .contains(":")) { 229 + if (header.name().equalsIgnoreCase("cookie")) { 230 + this.sentCookies = header.value(); 219 231 if (!this.sentCookies.isEmpty()) { 220 232 this.hasCookieParam = true; 221 233 this.sentCookies += ";"; // we need to ad this to search it in cookie Jar! 222 234 223 235 // Check to see if it uses cookie Jars! 224 - List<ICookie> cookieJars = LoggerPlusPlus.callbacks.getCookieJarContents(); 236 + List<Cookie> cookiesInJar = LoggerPlusPlus.montoya.http().cookieJar().cookies(); 225 237 boolean oneNotMatched = false; 226 238 boolean anyParamMatched = false; 227 239 228 - for (ICookie cookieItem : cookieJars) { 229 - if (cookieItem.getDomain ().equals(this.hostname)) { 240 + for (Cookie cookieItem : cookiesInJar) { 241 + if (cookieItem.domain ().equals(this.hostname)) { 230 242 // now we want to see if any of these cookies have been set here! 231 - String currentCookieJarParam = cookieItem.getName () + "=" + cookieItem.getValue () + ";"; 243 + String currentCookieJarParam = cookieItem.name () + "=" + cookieItem.value () + ";"; 232 244 if (this.sentCookies.contains(currentCookieJarParam)) { 233 245 anyParamMatched = true; 234 246 } else { skipped 10 lines 245 257 this.usesCookieJar = CookieJarStatus.YES; 246 258 } 247 259 } 248 - } else if (headerItem [ 0 ] .equalsIgnoreCase("referer")) { 249 - this.referrerURL = headerItem [ 1 ] ; 250 - } else if (headerItem [ 0 ] .equalsIgnoreCase("content-type")) { 251 - this.requestContentType = headerItem [ 1 ] ; 252 - } else if (headerItem [ 0 ] .equalsIgnoreCase("origin")) { 253 - this.origin = headerItem[1]; 260 + } else if (header . name ( ) .equalsIgnoreCase("referer")) { 261 + this.referrerURL = header . value ( ) ; 262 + } else if (header . name ( ) .equalsIgnoreCase("content-type")) { 263 + this.requestContentType = header . value ( ) ; 264 + } else if (header . name ( ) .equalsIgnoreCase("origin")) { 265 + this.origin = header.value(); 254 266 } 255 - } 267 + / / }256 268 } 257 269 258 270 return Status.AWAITING_RESPONSE; skipped 44 lines 303 315 //// this.regexAllReq[i] = allMatches.toString(); 304 316 // 305 317 // }catch(Exception e){ 306 - // LoggerPlusPlus.callbacks .printError("Error in regular expression: " + 318 + // LoggerPlusPlus.montoya .printError("Error in regular expression: " + 307 319 // regexString); 308 320 // } 309 321 // skipped 7 lines 317 329 * @param requestResponse 318 330 * @param arrivalTime 319 331 */ 320 - public void addResponse(IHttpRequestResponse requestResponse, Date arrivalTime) { 332 + public void addResponse(HttpResponse requestResponse, Date arrivalTime) { 321 333 this.responseDateTime = arrivalTime; 322 334 323 335 //IHttpRequestResponse objects received by the proxy listener do not contain the latest request. 324 336 //So we must store the content separately. 325 - this.response = requestResponse. getResponse ( ) ; 326 - this.setComment(requestResponse.getComment()); //Update the comment with the current comment 337 + this.response = requestResponse; 338 + / / this.setComment(requestResponse.getComment()); //Update the comment with the current comment327 339 } 328 340 329 341 private Status processResponse() { 330 342 reflectedParameters = new ArrayList<>(); 331 - IResponseInfo tempAnalyzedResp = LoggerPlusPlus.callbacks .getHelpers() 332 - .analyzeResponse(response); 343 + / / IResponseInfo tempAnalyzedResp = LoggerPlusPlus.montoya .getHelpers() 344 + / / .analyzeResponse(response);333 345 334 - this.responseStatus = tempAnalyzedResp .getStatusCode (); 335 - this.responseBodyLength = response.length - tempAnalyzedResp .getBodyOffset (); 336 - this.responseMimeType = tempAnalyzedResp.getStatedMimeType(); 337 - this.responseInferredMimeType = tempAnalyzedResp .getInferredMimeType (); 346 + this.responseStatus = response .statusCode (); 347 + this.responseBodyLength = response.body ( ) .length (); 348 + this.responseMimeType = response.statedMimeType(); 349 + this.responseInferredMimeType = response .inferredMimeType (); 338 350 339 351 /************************************** 340 352 ************HEADER PROCESSING********* 341 353 **************************************/ 342 354 343 - //Fancy handling to combine duplicate headers into CSVs. 344 - Map<String, String> headers = tempAnalyzedResp.getHeaders().stream().filter(s -> s.contains(":")) 345 - .collect(Collectors.toMap(s -> { 346 - String[] split = s.split(": ", 2); 347 - return split.length > 0 ? split[0] : ""; 348 - }, s -> { 349 - String[] split = s.split(": ", 2); 350 - if (split.length > 1) { 351 - return split[1]; 352 - } 353 - return ""; 354 - }, (s, s2) -> { 355 + Map<String, String> headers = response.headers().stream() 356 + .collect(Collectors.toMap(HttpHeader::name, HttpHeader::value, (s, s2) -> { 355 357 s += ", " + s2; 356 358 return s; 357 359 }, () -> new TreeMap<>(String.CASE_INSENSITIVE_ORDER))); 358 360 359 - responseHeaders = tempAnalyzedResp.getHeaders(); 361 + responseHeaders = response.headers(); 360 362 361 363 if (headers.containsKey("Location")) { 362 364 this.redirectURL = headers.get("Location"); 363 365 } 364 366 365 367 // Extract HTTP Status message 366 - String[] httpStatusTokens = responseHeaders.get(0).split(" "); 367 - this.responseStatusText = httpStatusTokens[httpStatusTokens.length - 1]; 368 - this.responseHttpVersion = httpStatusTokens[0]; 368 + HttpHeader httpStatusTokens = response.headers().get(0); 369 + //TODO FixMe 370 + // this.responseStatusText = httpStatusTokens[httpStatusTokens.length - 1]; 371 + // this.responseHttpVersion = httpStatusTokens[0]; 372 + 369 373 370 374 if (headers.containsKey("content-type")) { 371 375 this.responseContentType = headers.get("content-type"); 372 376 } 373 377 374 378 //Cookies 375 - for (ICookie cookieItem : tempAnalyzedResp.getCookies()) { 376 - this.newCookies += cookieItem.getName() + "=" + cookieItem.getValue() + "; "; //TODO convert to map, and add filter support for maps 377 - } 379 + this.newCookies = response.cookies().stream().map(cookie -> String.format("%s=%s", cookie.name(), cookie.value())).collect(Collectors.toList()); 378 380 this.hasSetCookies = !newCookies.isEmpty(); 379 381 380 382 skipped 27 lines 408 410 **************************************/ 409 411 410 412 Long maxRespSize = ((Integer) LoggerPlusPlus.instance.getPreferencesController().getPreferences().getSetting(Globals.PREF_MAX_RESP_SIZE)) * 1000000L; 411 - int bodyOffset = response.length - responseBodyLength ; 413 + int bodyOffset = response.bodyOffset ( ) ; 412 414 if (responseBodyLength < maxRespSize) { 413 415 //Only title match HTML files. Prevents expensive regex running on e.g. binary downloads. 414 - if (this.responseInferredMimeType.equalsIgnoreCase ( " HTML" ) ) { 415 - String strFullResponse = new String(response); 416 - Matcher titleMatcher = Globals.HTML_TITLE_PATTERN.matcher(strFullResponse); 416 + if (this.responseInferredMimeType = = MimeType .HTML) { 417 + Matcher titleMatcher = Globals.HTML_TITLE_PATTERN.matcher(response.bodyAsString()); 417 418 if (titleMatcher.find()) { 418 419 this.title = titleMatcher.group(1); 419 420 } 420 421 } 421 422 422 - String responseBody = new String(response, bodyOffset, responseBodyLength); 423 423 ReflectionController reflectionController = LoggerPlusPlus.instance.getReflectionController(); 424 - reflectedParameters = tempParameters .parallelStream() 425 - .filter(iParameter -> !reflectionController.isParameterFiltered(iParameter) 426 - && reflectionController.validReflection(responseBody, iParameter)) 427 - .map(IParameter::getName).collect(Collectors.toList()); 424 + reflectedParameters = request . parameters ( ) .parallelStream() 425 + .filter(parameter -> !reflectionController.isParameterFiltered(parameter) && reflectionController.validReflection(response.bodyAsString(), parameter)) 426 + .map(HttpParameter::name).collect(Collectors.toList()); 428 427 429 - // this.requestResponse = LoggerPlusPlus.callbacks .saveBuffersToTempFiles(requestResponse); 428 + // this.requestResponse = LoggerPlusPlus.montoya .saveBuffersToTempFiles(requestResponse); 430 429 } else { 431 430 //Just look for reflections in the headers. 432 431 ReflectionController reflectionController = LoggerPlusPlus.instance.getReflectionController(); 433 - reflectedParameters = tempParameters .parallelStream() 434 - .filter(iParameter -> !reflectionController.isParameterFiltered(iParameter ) 435 - && reflectionController.validReflection(new String(response, 0, bodyOffset), iParameter )) 436 - .map(IParameter ::getName ).collect(Collectors.toList()); 432 + reflectedParameters = request . parameters ( ) .parallelStream() 433 + .filter(parameter -> !reflectionController.isParameterFiltered(parameter ) 434 + && reflectionController.validReflection(new String(response. asBytes ( ) . getBytes ( ) , 0, bodyOffset), parameter )) 435 + .map(HttpParameter ::name ).collect(Collectors.toList()); 437 436 438 437 //Trim the response down to a maximum size, but at least keep the headers! 439 - this.response = (new String(this.response, 0, bodyOffset) + "Response body trimmed by Logger++. To prevent this, increase \"Maximum Response Size\" in the Logger++ options.").getBytes(StandardCharsets.UTF_8); 438 + //TODO Fix response trimming? 439 + // this.response = (new String(this.response, 0, bodyOffset) + "Response body trimmed by Logger++. To prevent this, increase \"Maximum Response Size\" in the Logger++ options.").getBytes(StandardCharsets.UTF_8); 440 440 } 441 - 442 - 443 - tempParameters = null; // We're done with these. Allow them to be cleaned. 444 441 445 442 this.complete = true; 446 443 skipped 40 lines 487 484 // this.regexAllResp[i] = allMatches.toString(); 488 485 // 489 486 // }catch(Exception e){ 490 - // LoggerPlusPlus.callbacks .printError("Error in regular expression: " + 487 + // LoggerPlusPlus.montoya .printError("Error in regular expression: " + 491 488 // regexString); 492 489 // } 493 490 // skipped 7 lines 501 498 // } 502 499 } 503 500 504 - public byte[] getRequest () { 505 - return this.requestResponse.getRequest(); 501 + public byte[] getRequestBytes () { 502 + return this.request.asBytes().getBytes(); 506 503 } 507 504 508 - public byte[] getResponse () { 509 - return response; 505 + public byte[] getResponseBytes () { 506 + return response. asBytes ( ) . getBytes ( ) ; 510 507 } 511 508 512 509 public void setReqestTime(Date requestTime) { skipped 7 lines 520 517 } 521 518 522 519 public void setComment(String comment) { 523 - this.requestResponse.setComment(comment); 520 + this.comment = comment; 524 521 } 525 522 526 523 public String getComment() { 527 - return this.requestResponse.getComment(); 524 + return this.comment; 528 525 } 529 526 530 527 skipped 3 lines 534 531 switch (columnName) { 535 532 case PROXY_TOOL: 536 533 case REQUEST_TOOL: 537 - return getToolName(); 534 + return tool.toolName(); 538 535 case TAGS: 539 536 return this.matchingTags.stream().map(Tag::getName).collect(Collectors.toList()); 540 537 case URL: 541 - return this.url ; 538 + return this.urlString ; 542 539 case PATH: 543 - return this.url.getPath(); 540 + return ( this . url ! = null ? this.url.getPath() : " " ); 544 541 case QUERY: 545 - return this.url.getQuery(); 542 + return ( this . url ! = null ? this.url.getQuery() : " " ); 546 543 case STATUS: 547 544 return this.responseStatus; 548 545 case STATUS_TEXT: skipped 19 lines 568 565 case RESPONSE_TIME: 569 566 return this.responseDateTime; 570 567 case COMMENT: 571 - return this.requestResponse.getComment(); 568 + return this.comment; 572 569 case REQUEST_CONTENT_TYPE: 573 570 return this.requestContentType; 574 571 case REQUEST_HTTP_VERSION: skipped 7 lines 582 579 case PARAMETER_COUNT: 583 580 return this.parameters.size(); 584 581 case HASGETPARAM: 585 - return this.url.getQuery() != null; 582 + return this.url ! = null & & this . url .getQuery() != null; 586 583 case HASPOSTPARAM: 587 584 return this.hasBodyParam; 588 585 case HASCOOKIEPARAM: skipped 52 lines 641 638 return reflectedParameters.size(); 642 639 case REQUEST_BODY: // request 643 640 if (requestBodyLength == 0) return ""; 644 - return new String(getRequest (), getRequest ().length - requestBodyLength, requestBodyLength); 641 + return new String(getRequestBytes (), getRequestBytes ().length - requestBodyLength, requestBodyLength); 645 642 // .substring(request.length - requestBodyLength); 646 643 case RESPONSE_BODY: // response 647 - if (responseBodyLength == 0) return ""; 648 - return new String(response, response.length - responseBodyLength, responseBodyLength); 649 - // .substring(response.length - responseBodyLength); 644 + return response.bodyAsString(); 650 645 case RTT: 651 646 return requestResponseDelay; 652 647 case REQUEST_HEADERS: 653 - return requestHeaders != null ? String.join("\r\n", requestHeaders) : ""; 648 + return requestHeaders != null ? requestHeaders.stream().map(HttpHeader::toString).collect(Collectors.joining("\r\n")) : ""; 654 649 case RESPONSE_HEADERS: 655 - return responseHeaders != null ? String.join("\r\n", responseHeaders) : ""; 650 + return responseHeaders != null ? responseHeaders.stream().map(HttpHeader::toString).collect(Collectors.joining("\r\n")) : ""; 656 651 case REDIRECT_URL: 657 652 return redirectURL; 658 653 case BASE64_REQUEST: 659 - return Base64.getEncoder().encodeToString(this.getRequest ()); 654 + return Base64.getEncoder().encodeToString(this.getRequestBytes ()); 660 655 case BASE64_RESPONSE: 661 - return Base64.getEncoder().encodeToString(response ); 656 + return Base64.getEncoder().encodeToString(this . getResponseBytes ( ) ); 662 657 case RESPONSE_HASH: { 663 658 if (responseHash == null) { 664 659 responseHash = DigestUtils skipped 17 lines 682 677 return matchingTags; 683 678 } 684 679 685 - public IHttpService getHttpService() { 686 - return this.requestResponse.getHttpService(); 680 + public HttpService getHttpService() { 681 + return this.request.httpService(); 687 682 } 688 683 689 684 public enum CookieJarStatus { skipped 73 lines 763 758 764 759 @Override 765 760 public String toString() { 766 - return this.url .toString(); 761 + return this.urlString .toString(); 767 762 } 768 763 769 - public static Integer extractAndRemoveIdentifierFromComment(LogEntry logEntry) { 770 - return LogProcessorHelper.extractAndRemoveIdentifierFromRequestResponseComment(logEntry.requestResponse ); 771 - } 764 + / / public static Integer extractAndRemoveIdentifierFromComment(LogEntry logEntry) { 765 + / / return LogProcessorHelper.extractAndRemoveIdentifierFromRequestResponseComment(logEntry.request ); 766 + / / }772 767 } 773 768