From 94668fe79e9eea5d9a36f118b1ff8a90fdab6dca Mon Sep 17 00:00:00 2001 From: Prudhvi Depuru Date: Sun, 13 Jul 2025 20:04:34 +0530 Subject: [PATCH 1/2] add request/response title --- .../csnc/burp/CopyRequestResponseCopyActions.java | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/src/main/java/ch/csnc/burp/CopyRequestResponseCopyActions.java b/src/main/java/ch/csnc/burp/CopyRequestResponseCopyActions.java index a09d27d..b4c6aeb 100644 --- a/src/main/java/ch/csnc/burp/CopyRequestResponseCopyActions.java +++ b/src/main/java/ch/csnc/burp/CopyRequestResponseCopyActions.java @@ -21,7 +21,7 @@ public static void copyFullFull(List requestResponses) { requestResponses .stream() .map(requestResponse -> - "%s\n\n%s".formatted( + "Request\n-----------------\n%s\n\nResponse\n-----------------\n%s".formatted( requestResponse.request().toString().strip(), Optional.ofNullable(requestResponse.response()) .map(HttpResponse::toString) @@ -37,12 +37,12 @@ public static void copyFullHeader(List requestResponses) { requestResponses .stream() .map(requestResponse -> { - var requestString = requestResponse.request().toString().strip(); + var requestString = "Request\n-----------------\n" + requestResponse.request().toString().strip(); var responseString = ""; if (requestResponse.hasResponse()) { var response = requestResponse.response(); - responseString = response.toString().substring(0, response.bodyOffset()).strip(); + responseString = "Response\n-----------------\n" + response.toString().substring(0, response.bodyOffset()).strip(); responseString += "\n\n"; responseString += CopyRequestResponseConfiguration.cutText(); } @@ -56,7 +56,7 @@ public static void copyFullHeader(List requestResponses) { public static void copyFullHeaderPlusSelectedData(MessageEditorHttpRequestResponse editor) { var requestResponse = editor.requestResponse(); - var requestString = requestResponse.request().toString().strip(); + var requestString = "Request\n-----------------\n" + requestResponse.request().toString().strip(); Supplier responseStringSupplier = () -> { if (!requestResponse.hasResponse()) { @@ -64,7 +64,7 @@ public static void copyFullHeaderPlusSelectedData(MessageEditorHttpRequestRespon } var response = requestResponse.response(); - var responseString = response.toString().substring(0, response.bodyOffset()).strip(); + var responseString = "Response\n-----------------\n" + response.toString().substring(0, response.bodyOffset()).strip(); responseString += "\n\n"; @@ -115,8 +115,6 @@ public static void copyFullHeaderPlusSelectedData(MessageEditorHttpRequestRespon var text = "%s\n\n%s".formatted(requestString, responseStringSupplier.get()); - // Ugly hack because VMware is messing up the clipboard if a text is still selected, the function - // has to be run in a separate thread which sleeps for 0.2 seconds. var thread = new Thread(() -> { try { Thread.sleep(200); @@ -140,7 +138,6 @@ private static void toClipboard(String text0) { } private CopyRequestResponseCopyActions() { - // static class } -} +} \ No newline at end of file From 47ffdb9235758b54589c81e4823a888b8770b753 Mon Sep 17 00:00:00 2001 From: Prudhvi Depuru Date: Sun, 13 Jul 2025 20:12:39 +0530 Subject: [PATCH 2/2] added deleted comments --- .../java/ch/csnc/burp/CopyRequestResponseCopyActions.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/main/java/ch/csnc/burp/CopyRequestResponseCopyActions.java b/src/main/java/ch/csnc/burp/CopyRequestResponseCopyActions.java index b4c6aeb..bc10893 100644 --- a/src/main/java/ch/csnc/burp/CopyRequestResponseCopyActions.java +++ b/src/main/java/ch/csnc/burp/CopyRequestResponseCopyActions.java @@ -114,7 +114,9 @@ public static void copyFullHeaderPlusSelectedData(MessageEditorHttpRequestRespon }; var text = "%s\n\n%s".formatted(requestString, responseStringSupplier.get()); - + + // Ugly hack because VMware is messing up the clipboard if a text is still selected, the function + // has to be run in a separate thread which sleeps for 0.2 seconds. var thread = new Thread(() -> { try { Thread.sleep(200); @@ -138,6 +140,7 @@ private static void toClipboard(String text0) { } private CopyRequestResponseCopyActions() { + // static class } } \ No newline at end of file