|
6 | 6 | import burp.IHttpService; |
7 | 7 | import extension.burp.HttpService; |
8 | 8 | import extension.helpers.ConvertUtil; |
| 9 | +import extension.helpers.FileUtil; |
9 | 10 | import extension.helpers.HttpUtil; |
10 | 11 | import extension.helpers.StringUtil; |
11 | 12 | import java.awt.event.ActionEvent; |
@@ -94,8 +95,8 @@ public void run() { |
94 | 95 | ostm.write(StringUtil.getBytesRaw(String.format("Content-Type: %s", "multipart/form-data;boundary=" + boundary) + StringUtil.NEW_LINE)); |
95 | 96 | try (ByteArrayOutputStream bodyStream = new ByteArrayOutputStream()) { |
96 | 97 | outMultipart(boundary, bodyStream, messageInfo); |
97 | | - //ostm.write(StringUtil.getBytesRaw(String.format("Content-Length: %d", bodyStream.size()) + StringUtil.NEW_LINE)); |
98 | | - //ostm.write(StringUtil.getBytesRaw("Connection: close" + StringUtil.NEW_LINE)); |
| 98 | + ostm.write(StringUtil.getBytesRaw(String.format("Content-Length: %d", bodyStream.size()) + StringUtil.NEW_LINE)); |
| 99 | + ostm.write(StringUtil.getBytesRaw("Connection: close" + StringUtil.NEW_LINE)); |
99 | 100 | ostm.write(StringUtil.getBytesRaw(StringUtil.NEW_LINE)); |
100 | 101 | ostm.write(bodyStream.toByteArray()); |
101 | 102 | } |
@@ -227,7 +228,7 @@ public void connectFailed(URI uri, SocketAddress sa, IOException ex) { |
227 | 228 |
|
228 | 229 | protected void outPostHeader(OutputStream out, URL tagetURL) throws IOException, Exception { |
229 | 230 | HttpService httpService = new HttpService(tagetURL); |
230 | | - out.write(StringUtil.getBytesRaw(String.format("POST %s HTTP/1.1", tagetURL.getFile()) + HttpUtil.LINE_TERMINATE)); |
| 231 | + out.write(StringUtil.getBytesRaw(String.format("POST %s HTTP/1.1", FileUtil.appendLastSeparator(tagetURL.getFile(), "/")) + HttpUtil.LINE_TERMINATE)); |
231 | 232 | out.write(StringUtil.getBytesRaw(String.format("Host: %s", HttpUtil.buildHost(httpService.getHost(), httpService.getPort(), httpService.isHttps())) + HttpUtil.LINE_TERMINATE)); |
232 | 233 | out.write(StringUtil.getBytesRaw(String.format("User-Agent: %s", "Java-http-client/BurpSuite") + StringUtil.NEW_LINE)); |
233 | 234 | } |
|
0 commit comments