mirror of
https://github.com/jetty/jetty.project.git
synced 2025-03-03 20:39:18 +00:00
Merge remote-tracking branch 'eclipse/jetty-9.4.x-1027-Multipart' into jetty-9.4.x-1027-Multipart
This commit is contained in:
commit
379a8d6928
@ -28,7 +28,6 @@ import java.io.BufferedReader;
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
import java.io.OutputStream;
|
||||
import java.nio.charset.Charset;
|
||||
import java.nio.file.Files;
|
||||
import java.nio.file.Path;
|
||||
import java.security.DigestOutputStream;
|
||||
@ -46,7 +45,6 @@ import javax.servlet.http.Part;
|
||||
import org.eclipse.jetty.toolchain.test.Hex;
|
||||
import org.eclipse.jetty.toolchain.test.MavenTestingUtils;
|
||||
import org.eclipse.jetty.toolchain.test.TestingDir;
|
||||
import org.eclipse.jetty.util.BufferUtil;
|
||||
import org.eclipse.jetty.util.IO;
|
||||
import org.eclipse.jetty.util.QuotedStringTokenizer;
|
||||
import org.eclipse.jetty.util.StringUtil;
|
||||
@ -60,8 +58,8 @@ import org.junit.runners.Parameterized;
|
||||
public class MultiPartCaptureTest
|
||||
{
|
||||
|
||||
public static final int MAX_FILE_SIZE = 60 * 1024;
|
||||
public static final int MAX_REQUEST_SIZE = 1024 * 1024;
|
||||
public static final int MAX_FILE_SIZE = 2 * 1024 * 1024;
|
||||
public static final int MAX_REQUEST_SIZE = MAX_FILE_SIZE + (60 * 1024);
|
||||
public static final int FILE_SIZE_THRESHOLD = 50;
|
||||
|
||||
@Parameterized.Parameters(name = "{0}")
|
||||
@ -69,25 +67,41 @@ public class MultiPartCaptureTest
|
||||
{
|
||||
List<Object[]> ret = new ArrayList<>();
|
||||
|
||||
// Capture of raw request body contents from Apache HttpComponents 4.5.5
|
||||
ret.add(new String[]{"multipart-text-files"});
|
||||
// == Arbitrary / Non-Standard Examples ==
|
||||
|
||||
ret.add(new String[]{"multipart-uppercase"});
|
||||
// ret.add(new String[]{"multipart-base64"}); // base64 transfer encoding deprecated
|
||||
// ret.add(new String[]{"multipart-base64-long"}); // base64 transfer encoding deprecated
|
||||
// ret.add(new String[]{"multipart-complex"}); // TODO joakime bad capture includes ? in sjis content
|
||||
ret.add(new String[]{"multipart-duplicate-names-1"});
|
||||
ret.add(new String[]{"multipart-encoding-mess"});
|
||||
// ret.add(new String[]{"multipart-inside-itself"}); // impossible test, badly chosen boundary
|
||||
// ret.add(new String[]{"multipart-inside-itself-binary"}); // impossible test, badly chosen boundary
|
||||
ret.add(new String[]{"multipart-number-browser"});
|
||||
ret.add(new String[]{"multipart-number-strict"});
|
||||
// ret.add(new String[]{"multipart-sjis"}); // TODO joakime bad capture includes ? in sjis content
|
||||
ret.add(new String[]{"multipart-strange-quoting"});
|
||||
ret.add(new String[]{"multipart-unicode-names"});
|
||||
ret.add(new String[]{"multipart-uppercase"});
|
||||
// ret.add(new String[]{"multipart-x-www-form-urlencoded"}); // not our job to decode content
|
||||
ret.add(new String[]{"multipart-zencoding"});
|
||||
|
||||
// Capture of raw request body contents from various browsers
|
||||
// == Capture of raw request body contents from Apache HttpClient 4.5.5 ==
|
||||
|
||||
ret.add(new String[]{"browser-capture-company-urlencoded-apache-httpcomp"});
|
||||
ret.add(new String[]{"browser-capture-complex-apache-httpcomp"});
|
||||
ret.add(new String[]{"browser-capture-duplicate-names-apache-httpcomp"});
|
||||
ret.add(new String[]{"browser-capture-encoding-mess-apache-httpcomp"});
|
||||
ret.add(new String[]{"browser-capture-nested-apache-httpcomp"});
|
||||
ret.add(new String[]{"browser-capture-nested-binary-apache-httpcomp"});
|
||||
ret.add(new String[]{"browser-capture-number-only2-apache-httpcomp"});
|
||||
ret.add(new String[]{"browser-capture-number-only-apache-httpcomp"});
|
||||
ret.add(new String[]{"browser-capture-sjis-apache-httpcomp"});
|
||||
ret.add(new String[]{"browser-capture-strange-quoting-apache-httpcomp"});
|
||||
ret.add(new String[]{"browser-capture-text-files-apache-httpcomp"});
|
||||
ret.add(new String[]{"browser-capture-unicode-names-apache-httpcomp"});
|
||||
ret.add(new String[]{"browser-capture-zalgo-text-plain-apache-httpcomp"});
|
||||
|
||||
// == Capture of raw request body contents from Eclipse Jetty Http Client 9.4.9 ==
|
||||
|
||||
ret.add(new String[]{"browser-capture-complex-jetty-client"});
|
||||
ret.add(new String[]{"browser-capture-duplicate-names-jetty-client"});
|
||||
ret.add(new String[]{"browser-capture-encoding-mess-jetty-client"});
|
||||
ret.add(new String[]{"browser-capture-nested-jetty-client"});
|
||||
ret.add(new String[]{"browser-capture-number-only-jetty-client"});
|
||||
ret.add(new String[]{"browser-capture-sjis-jetty-client"});
|
||||
ret.add(new String[]{"browser-capture-text-files-jetty-client"});
|
||||
ret.add(new String[]{"browser-capture-unicode-names-jetty-client"});
|
||||
ret.add(new String[]{"browser-capture-whitespace-only-jetty-client"});
|
||||
|
||||
// == Capture of raw request body contents from various browsers ==
|
||||
|
||||
// simple form - 2 fields
|
||||
ret.add(new String[]{"browser-capture-form1-android-chrome"});
|
||||
@ -100,13 +114,14 @@ public class MultiPartCaptureTest
|
||||
ret.add(new String[]{"browser-capture-form1-osx-safari"});
|
||||
|
||||
// form submitted as shift-jis
|
||||
ret.add(new String[]{"browser-capture-sjis-form-edge"});
|
||||
ret.add(new String[]{"browser-capture-sjis-form-msie"});
|
||||
// TODO: these might be addressable via Issue #2398
|
||||
// ret.add(new String[]{"browser-capture-sjis-form-android-chrome"}); // contains html encoded character and unspecified charset defaults to utf-8
|
||||
// ret.add(new String[]{"browser-capture-sjis-form-android-firefox"}); // contains html encoded character and unspecified charset defaults to utf-8
|
||||
// ret.add(new String[]{"browser-capture-sjis-form-chrome"}); // contains html encoded character and unspecified charset defaults to utf-8
|
||||
ret.add(new String[]{"browser-capture-sjis-form-edge"});
|
||||
// ret.add(new String[]{"browser-capture-sjis-form-firefox"}); // contains html encoded character and unspecified charset defaults to utf-8
|
||||
// ret.add(new String[]{"browser-capture-sjis-form-ios-safari"}); // contains html encoded character and unspecified charset defaults to utf-8
|
||||
ret.add(new String[]{"browser-capture-sjis-form-msie"});
|
||||
// ret.add(new String[]{"browser-capture-sjis-form-safari"}); // contains html encoded character and unspecified charset defaults to utf-8
|
||||
|
||||
// form submitted as shift-jis (with HTML5 specific hidden _charset_ field)
|
||||
@ -133,7 +148,6 @@ public class MultiPartCaptureTest
|
||||
ret.add(new String[]{"browser-capture-form-fileupload-alt-chrome"});
|
||||
ret.add(new String[]{"browser-capture-form-fileupload-alt-edge"});
|
||||
ret.add(new String[]{"browser-capture-form-fileupload-alt-firefox"});
|
||||
// ret.add(new String[]{"browser-capture-form-fileupload-alt-ios-safari"}); // is Sha1sum correct new parser gives same result as old parser
|
||||
ret.add(new String[]{"browser-capture-form-fileupload-alt-msie"});
|
||||
ret.add(new String[]{"browser-capture-form-fileupload-alt-safari"});
|
||||
|
||||
|
@ -0,0 +1,9 @@
|
||||
Request-Header|Accept-Encoding|gzip,deflate
|
||||
Request-Header|Connection|keep-alive
|
||||
Request-Header|Content-Length|248
|
||||
Request-Header|Content-Type|multipart/form-data; boundary=DHbU6ChASebwm4iE8z9Lakv4ybMmkp
|
||||
Request-Header|Host|localhost:9090
|
||||
Request-Header|User-Agent|Apache-HttpClient/4.5.5 (Java/1.8.0_162)
|
||||
Request-Header|X-BrowserId|apache-httpcomp
|
||||
Parts-Count|1
|
||||
Part-ContainsContents|company|bob+%26+frank%27s+shoe+repair
|
Binary file not shown.
@ -0,0 +1,15 @@
|
||||
Request-Header|Accept-Encoding|gzip,deflate
|
||||
Request-Header|Connection|keep-alive
|
||||
Request-Header|Content-Length|22940
|
||||
Request-Header|Content-Type|multipart/form-data; boundary=owr6UQGvVNunA_sx2AsizBtyq_uK-OjsQXrF
|
||||
Request-Header|Host|localhost:9090
|
||||
Request-Header|User-Agent|Apache-HttpClient/4.5.5 (Java/1.8.0_162)
|
||||
Request-Header|X-BrowserId|apache-httpcomp
|
||||
Parts-Count|6
|
||||
Part-ContainsContents|pi|3.14159265358979323846264338327950288419716939937510
|
||||
Part-ContainsContents|company|bob & frank's shoe repair
|
||||
Part-ContainsContents|power|ꬵо𝗋ⲥ𝖾
|
||||
Part-ContainsContents|japanese|オープンソース
|
||||
Part-ContainsContents|hello|日食桟橋
|
||||
Part-Filename|upload_file|filename
|
||||
Part-Sha1sum|upload_file|e75b73644afe9b234d70da9ff225229de68cdff8
|
Binary file not shown.
@ -0,0 +1,15 @@
|
||||
Request-Header|Accept-Encoding|gzip
|
||||
Request-Header|Connection|close
|
||||
Request-Header|Content-Type|multipart/form-data; boundary=JettyHttpClientBoundary1275gffetpxz8o0q
|
||||
Request-Header|Host|localhost:9090
|
||||
Request-Header|Transfer-Encoding|chunked
|
||||
Request-Header|User-Agent|Jetty/9.4.9.v20180320
|
||||
Request-Header|X-BrowserId|jetty-client
|
||||
Parts-Count|6
|
||||
Part-ContainsContents|pi|3.14159265358979323846264338327950288419716939937510
|
||||
Part-ContainsContents|company|bob & frank's shoe repair
|
||||
Part-ContainsContents|power|ꬵо𝗋ⲥ𝖾
|
||||
Part-ContainsContents|japanese|オープンソース
|
||||
Part-ContainsContents|hello|日食桟橋
|
||||
Part-Filename|upload_file|filename
|
||||
Part-Sha1sum|upload_file|e75b73644afe9b234d70da9ff225229de68cdff8
|
Binary file not shown.
@ -0,0 +1,8 @@
|
||||
Request-Header|Accept-Encoding|gzip,deflate
|
||||
Request-Header|Connection|keep-alive
|
||||
Request-Header|Content-Length|1815
|
||||
Request-Header|Content-Type|multipart/form-data; boundary=QW3F8Fg64P2J2dpfEKGKlX0Q9QF2a8SK_7YH
|
||||
Request-Header|Host|localhost:9090
|
||||
Request-Header|User-Agent|Apache-HttpClient/4.5.5 (Java/1.8.0_162)
|
||||
Request-Header|X-BrowserId|apache-httpcomp
|
||||
Parts-Count|10
|
Binary file not shown.
@ -0,0 +1,8 @@
|
||||
Request-Header|Accept-Encoding|gzip
|
||||
Request-Header|Connection|close
|
||||
Request-Header|Content-Type|multipart/form-data; boundary=JettyHttpClientBoundary14beb4to333d91v8
|
||||
Request-Header|Host|localhost:9090
|
||||
Request-Header|Transfer-Encoding|chunked
|
||||
Request-Header|User-Agent|Jetty/9.4.9.v20180320
|
||||
Request-Header|X-BrowserId|jetty-client
|
||||
Parts-Count|10
|
Binary file not shown.
@ -0,0 +1,11 @@
|
||||
Request-Header|Accept-Encoding|gzip,deflate
|
||||
Request-Header|Connection|keep-alive
|
||||
Request-Header|Content-Length|31148
|
||||
Request-Header|Content-Type|multipart/form-data; boundary=qqr2YBBR31U4xVib4vaVuIsrwNY1iw
|
||||
Request-Header|Host|localhost:9090
|
||||
Request-Header|User-Agent|Apache-HttpClient/4.5.5 (Java/1.8.0_162)
|
||||
Request-Header|X-BrowserId|apache-httpcomp
|
||||
Parts-Count|169
|
||||
Part-ContainsContents|count|168
|
||||
Part-ContainsContents|persian-UTF-8|برج بابل
|
||||
Part-ContainsContents|persian-CESU-8|برج بابل
|
Binary file not shown.
@ -0,0 +1,11 @@
|
||||
Request-Header|Accept-Encoding|gzip
|
||||
Request-Header|Connection|close
|
||||
Request-Header|Content-Type|multipart/form-data; boundary=JettyHttpClientBoundary1jcfdl0zps9nf362
|
||||
Request-Header|Host|localhost:9090
|
||||
Request-Header|Transfer-Encoding|chunked
|
||||
Request-Header|User-Agent|Jetty/9.4.9.v20180320
|
||||
Request-Header|X-BrowserId|jetty-client
|
||||
Parts-Count|169
|
||||
Part-ContainsContents|count|168
|
||||
Part-ContainsContents|persian-UTF-8|برج بابل
|
||||
Part-ContainsContents|persian-CESU-8|برج بابل
|
Binary file not shown.
@ -1,18 +0,0 @@
|
||||
Request-Header|Accept|text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
|
||||
Request-Header|Accept-Encoding|gzip, deflate
|
||||
Request-Header|Accept-Language|en-us
|
||||
Request-Header|Connection|keep-alive
|
||||
Request-Header|Content-Length|22359
|
||||
Request-Header|Content-Type|multipart/form-data; boundary=----WebKitFormBoundaryb59mxzeFXckWXDD0
|
||||
Request-Header|Host|192.168.0.119:9090
|
||||
Request-Header|Origin|http://192.168.0.119:9090
|
||||
Request-Header|Referer|http://192.168.0.119:9090/form-fileupload-multi.html
|
||||
Request-Header|Upgrade-Insecure-Requests|1
|
||||
Request-Header|User-Agent|Mozilla/5.0 (iPad; CPU OS 11_2_6 like Mac OS X) AppleWebKit/604.5.6 (KHTML, like Gecko) Version/11.0 Mobile/15D100 Safari/604.1
|
||||
Parts-Count|4
|
||||
Part-ContainsContents|description|the larger icon
|
||||
Part-ContainsContents|alternate|Text.raw
|
||||
Part-Filename|file|36037FD9-841C-4803-AA7E-354EF727AA06.png
|
||||
Part-Sha1sum|file|e75b73644afe9b234d70da9ff225229de68cdff8
|
||||
Part-Filename|file-alt|Text File.txt
|
||||
Part-Sha1sum|file-alt|5fb031816a27d80cc88c390819addab0ec3c189b
|
@ -0,0 +1,12 @@
|
||||
Request-Header|Accept-Encoding|gzip,deflate
|
||||
Request-Header|Connection|keep-alive
|
||||
Request-Header|Content-Length|1203
|
||||
Request-Header|Content-Type|multipart/form-data; boundary=Cku4UvJrPFCXkXjge2a2Y2sgq1bbOa
|
||||
Request-Header|Host|localhost:9090
|
||||
Request-Header|User-Agent|Apache-HttpClient/4.5.5 (Java/1.8.0_162)
|
||||
Request-Header|X-BrowserId|apache-httpcomp
|
||||
Parts-Count|4
|
||||
Part-ContainsContents|reporter|<user@company.com>
|
||||
Part-ContainsContents|timestamp|2018-03-21T18:52:18+00:00
|
||||
Part-ContainsContents|comments|this couldn't be parsed
|
||||
Part-ContainsContents|attachment|banana
|
Binary file not shown.
@ -0,0 +1,12 @@
|
||||
Request-Header|Accept-Encoding|gzip,deflate
|
||||
Request-Header|Connection|keep-alive
|
||||
Request-Header|Content-Length|1577
|
||||
Request-Header|Content-Type|multipart/form-data; boundary=xDeLGHDDsXrlJSXfqDmg5IRop7auqTTBXuI
|
||||
Request-Header|Host|localhost:9090
|
||||
Request-Header|User-Agent|Apache-HttpClient/4.5.5 (Java/1.8.0_162)
|
||||
Request-Header|X-BrowserId|apache-httpcomp
|
||||
Parts-Count|4
|
||||
Part-ContainsContents|reporter|<user@company.com>
|
||||
Part-ContainsContents|timestamp|2018-03-21T19:00:18+00:00
|
||||
Part-ContainsContents|comments|this also couldn't be parsed
|
||||
Part-ContainsContents|attachment|cherry
|
Binary file not shown.
@ -0,0 +1,12 @@
|
||||
Request-Header|Accept-Encoding|gzip
|
||||
Request-Header|Connection|close
|
||||
Request-Header|Content-Type|multipart/form-data; boundary=JettyHttpClientBoundary1uz60vid2bq7x1t9
|
||||
Request-Header|Host|localhost:9090
|
||||
Request-Header|Transfer-Encoding|chunked
|
||||
Request-Header|User-Agent|Jetty/9.4.9.v20180320
|
||||
Request-Header|X-BrowserId|jetty-client
|
||||
Parts-Count|4
|
||||
Part-ContainsContents|reporter|<user@company.com>
|
||||
Part-ContainsContents|timestamp|2018-03-21T18:52:18+00:00
|
||||
Part-ContainsContents|comments|this couldn't be parsed
|
||||
Part-ContainsContents|attachment|banana
|
Binary file not shown.
@ -0,0 +1,9 @@
|
||||
Request-Header|Accept-Encoding|gzip,deflate
|
||||
Request-Header|Connection|keep-alive
|
||||
Request-Header|Content-Length|173
|
||||
Request-Header|Content-Type|multipart/form-data; boundary=xE8WoYDcbqAfj08bxPk669iK22hMMlZL
|
||||
Request-Header|Host|localhost:9090
|
||||
Request-Header|User-Agent|Apache-HttpClient/4.5.5 (Java/1.8.0_162)
|
||||
Request-Header|X-BrowserId|apache-httpcomp
|
||||
Parts-Count|1
|
||||
Part-ContainsContents|pi|3.14159265358979323846264338327950288419716939937510
|
Binary file not shown.
@ -0,0 +1,12 @@
|
||||
Request-Header|Accept-Encoding|gzip
|
||||
Request-Header|Connection|close
|
||||
Request-Header|Content-Type|multipart/form-data; boundary=JettyHttpClientBoundary1shlqpw2yahae6jf
|
||||
Request-Header|Host|localhost:9090
|
||||
Request-Header|Transfer-Encoding|chunked
|
||||
Request-Header|User-Agent|Jetty/9.4.9.v20180320
|
||||
Request-Header|X-BrowserId|jetty-client
|
||||
Parts-Count|1
|
||||
# Start of sequence
|
||||
Part-ContainsContents|pi|3.14159 26535 89793 23846 26433 83279 50288
|
||||
# End of sequence
|
||||
Part-ContainsContents|pi|81592 05600 10165 52563 7567
|
Binary file not shown.
@ -0,0 +1,9 @@
|
||||
Request-Header|Accept-Encoding|gzip,deflate
|
||||
Request-Header|Connection|keep-alive
|
||||
Request-Header|Content-Length|240
|
||||
Request-Header|Content-Type|multipart/form-data; boundary=L8vdau8TpP0o-AYJDjCuYFQYnjB5gcHIFyap
|
||||
Request-Header|Host|localhost:9090
|
||||
Request-Header|User-Agent|Apache-HttpClient/4.5.5 (Java/1.8.0_162)
|
||||
Request-Header|X-BrowserId|apache-httpcomp
|
||||
Parts-Count|1
|
||||
Part-ContainsContents|pi|3.14159265358979323846264338327950288419716939937510
|
Binary file not shown.
@ -0,0 +1,10 @@
|
||||
Request-Header|Accept-Encoding|gzip,deflate
|
||||
Request-Header|Connection|keep-alive
|
||||
Request-Header|Content-Length|406
|
||||
Request-Header|Content-Type|multipart/form-data; boundary=u7tfLQaHJEHHUJjnVDbFdc_Oqz4jmkA25mgWd
|
||||
Request-Header|Host|localhost:9090
|
||||
Request-Header|User-Agent|Apache-HttpClient/4.5.5 (Java/1.8.0_162)
|
||||
Request-Header|X-BrowserId|apache-httpcomp
|
||||
Parts-Count|2
|
||||
Part-ContainsContents|japanese|オープンソース
|
||||
Part-ContainsContents|hello|日食桟橋
|
Binary file not shown.
@ -0,0 +1,10 @@
|
||||
Request-Header|Accept-Encoding|gzip
|
||||
Request-Header|Connection|close
|
||||
Request-Header|Content-Type|multipart/form-data; boundary=JettyHttpClientBoundaryny8fndkswj5ot6hx
|
||||
Request-Header|Host|localhost:9090
|
||||
Request-Header|Transfer-Encoding|chunked
|
||||
Request-Header|User-Agent|Jetty/9.4.9.v20180320
|
||||
Request-Header|X-BrowserId|jetty-client
|
||||
Parts-Count|2
|
||||
Part-ContainsContents|japanese|オープンソース
|
||||
Part-ContainsContents|hello|日食桟橋
|
Binary file not shown.
@ -0,0 +1,11 @@
|
||||
Request-Header|Accept-Encoding|gzip,deflate
|
||||
Request-Header|Connection|keep-alive
|
||||
Request-Header|Content-Length|798
|
||||
Request-Header|Content-Type|multipart/form-data; boundary=z5xWs05oeiE0TAdFlrrlAX5RSgHrHzVcgskrru
|
||||
Request-Header|Host|localhost:9090
|
||||
Request-Header|User-Agent|Apache-HttpClient/4.5.5 (Java/1.8.0_162)
|
||||
Request-Header|X-BrowserId|apache-httpcomp
|
||||
Parts-Count|4
|
||||
Part-ContainsContents|and "I" quote|Value 1
|
||||
Part-ContainsContents|and+%22I%22+quote|Value 2
|
||||
Part-ContainsContents|value"; what="whoa"|Value 3
|
Binary file not shown.
@ -0,0 +1,15 @@
|
||||
Request-Header|Accept-Encoding|gzip,deflate
|
||||
Request-Header|Connection|keep-alive
|
||||
Request-Header|Content-Length|737
|
||||
Request-Header|Content-Type|multipart/form-data; boundary=B8x_673_DRSeYGTpUMgof-qN1nircWQA
|
||||
Request-Header|Host|localhost:9090
|
||||
Request-Header|User-Agent|Apache-HttpClient/4.5.5 (Java/1.8.0_162)
|
||||
Request-Header|X-BrowserId|apache-httpcomp
|
||||
Parts-Count|3
|
||||
Part-ContainsContents|text|text default
|
||||
Part-ContainsContents|file1|Content of a.txt
|
||||
Part-ContainsContents|file2|<!DOCTYPE html><title>Content of a.html
|
||||
Part-Filename|file1|a.txt
|
||||
Part-Filename|file2|a.html
|
||||
Part-Sha1sum|file1|588A0F273CB5AFE9C8D76DD081812E672F2061E2
|
||||
Part-Sha1sum|file2|9A9005159AB90A6D2D9BACB5414EFE932F0CED85
|
Binary file not shown.
@ -0,0 +1,15 @@
|
||||
Request-Header|Accept-Encoding|gzip
|
||||
Request-Header|Connection|close
|
||||
Request-Header|Content-Type|multipart/form-data; boundary=JettyHttpClientBoundary1e87p8a551psw1al
|
||||
Request-Header|Host|localhost:9090
|
||||
Request-Header|Transfer-Encoding|chunked
|
||||
Request-Header|User-Agent|Jetty/9.4.9.v20180320
|
||||
Request-Header|X-BrowserId|jetty-client
|
||||
Parts-Count|3
|
||||
Part-ContainsContents|text|text default
|
||||
Part-ContainsContents|file1|Content of a.txt
|
||||
Part-ContainsContents|file2|<!DOCTYPE html><title>Content of a.html
|
||||
Part-Filename|file1|a.txt
|
||||
Part-Filename|file2|a.html
|
||||
Part-Sha1sum|file1|588A0F273CB5AFE9C8D76DD081812E672F2061E2
|
||||
Part-Sha1sum|file2|9A9005159AB90A6D2D9BACB5414EFE932F0CED85
|
Binary file not shown.
@ -0,0 +1,11 @@
|
||||
Request-Header|Accept-Encoding|gzip,deflate
|
||||
Request-Header|Connection|keep-alive
|
||||
Request-Header|Content-Length|475
|
||||
Request-Header|Content-Type|multipart/form-data; boundary=yRxfRSltW63lJPc9oHOOVyCn-SmDG6i4Ts9M4E6
|
||||
Request-Header|Host|localhost:9090
|
||||
Request-Header|User-Agent|Apache-HttpClient/4.5.5 (Java/1.8.0_162)
|
||||
Request-Header|X-BrowserId|apache-httpcomp
|
||||
Parts-Count|2
|
||||
Part-ContainsContents|こんにちは世界|Greetings 1
|
||||
Part-ContainsContents|%E3%81%93%E3%82%93%E3%81%AB%E3%81%A1%E3%81%AF%E4%B8%96%E7%95%8C|Greetings 2
|
||||
|
Binary file not shown.
@ -0,0 +1,11 @@
|
||||
Request-Header|Accept-Encoding|gzip
|
||||
Request-Header|Connection|close
|
||||
Request-Header|Content-Type|multipart/form-data; boundary=JettyHttpClientBoundary9iv9jofnq5dkzmgl
|
||||
Request-Header|Host|localhost:9090
|
||||
Request-Header|Transfer-Encoding|chunked
|
||||
Request-Header|User-Agent|Jetty/9.4.9.v20180320
|
||||
Request-Header|X-BrowserId|jetty-client
|
||||
Parts-Count|2
|
||||
Part-ContainsContents|こんにちは世界|Greetings 1
|
||||
Part-ContainsContents|%E3%81%93%E3%82%93%E3%81%AB%E3%81%A1%E3%81%AF%E4%B8%96%E7%95%8C|Greetings 2
|
||||
|
Binary file not shown.
@ -0,0 +1,10 @@
|
||||
Request-Header|Accept-Encoding|gzip
|
||||
Request-Header|Connection|close
|
||||
Request-Header|Content-Type|multipart/form-data; boundary=JettyHttpClientBoundary1evz7ehqg8tvo10h
|
||||
Request-Header|Host|localhost:9090
|
||||
Request-Header|Transfer-Encoding|chunked
|
||||
Request-Header|User-Agent|Jetty/9.4.9.v20180320
|
||||
Request-Header|X-BrowserId|jetty-client
|
||||
Parts-Count|1
|
||||
Part-Filename|whitespace|whitespace.txt
|
||||
Part-Sha1sum|whitespace|353E2CCDDE1069706B950414B230B6C047F98491
|
Binary file not shown.
@ -1,8 +1,12 @@
|
||||
Content-Type|multipart/form-data; boundary="UuAU1liVuDVE7wfJUYE72PUF9DZafZ"
|
||||
Request-Header|Accept-Encoding|gzip,deflate
|
||||
Request-Header|Connection|keep-alive
|
||||
Request-Header|Content-Length|1870
|
||||
Request-Header|Content-Type|multipart/form-data; boundary=V9oY7Ug2J-n4sFXLWdb7yd2LtU0hdK36ejhKYh
|
||||
Request-Header|Host|localhost:9090
|
||||
Request-Header|User-Agent|Apache-HttpClient/4.5.5 (Java/1.8.0_162)
|
||||
Request-Header|X-BrowserId|apache-httpcomp
|
||||
Parts-Count|4
|
||||
Part-ContainsContents|zalgo-8|y͔͕͍o̪̞͎̥͇̤̕u'̛̰̫̳̰v̧̘̪̠̟̟e̥͈̱ ̥̠͇͎͕̜s̤e̺e̙ͅņ̜ ̲̟͝za̴͖̱̲͈̘l͖̖͓̙̮͔g͕̞͖͘o͕̤͈̗ ̯̲̹̲͓b͙͟e̞͎̜̗͈͉̭͞f̸or̰̩e̡̝̺,̸͕̙̥̼͇̜ ̪͇̹r̘̪ͅị͔̥͈ͅg̠̟̯͖̦͇ht͖̪͍͚̖͡?͙̝͖̞
|
||||
Part-ContainsContents|zalgo-16|y͔͕͍o̪̞͎̥͇̤̕u'̛̰̫̳̰v̧̘̪̠̟̟e̥͈̱ ̥̠͇͎͕̜s̤e̺e̙ͅņ̜ ̲̟͝za̴͖̱̲͈̘l͖̖͓̙̮͔g͕̞͖͘o͕̤͈̗ ̯̲̹̲͓b͙͟e̞͎̜̗͈͉̭͞f̸or̰̩e̡̝̺,̸͕̙̥̼͇̜ ̪͇̹r̘̪ͅị͔̥͈ͅg̠̟̯͖̦͇ht͖̪͍͚̖͡?͙̝͖̞
|
||||
Part-ContainsContents|zalgo-16-be|y͔͕͍o̪̞͎̥͇̤̕u'̛̰̫̳̰v̧̘̪̠̟̟e̥͈̱ ̥̠͇͎͕̜s̤e̺e̙ͅņ̜ ̲̟͝za̴͖̱̲͈̘l͖̖͓̙̮͔g͕̞͖͘o͕̤͈̗ ̯̲̹̲͓b͙͟e̞͎̜̗͈͉̭͞f̸or̰̩e̡̝̺,̸͕̙̥̼͇̜ ̪͇̹r̘̪ͅị͔̥͈ͅg̠̟̯͖̦͇ht͖̪͍͚̖͡?͙̝͖̞
|
||||
Part-ContainsContents|zalgo-16-le|y͔͕͍o̪̞͎̥͇̤̕u'̛̰̫̳̰v̧̘̪̠̟̟e̥͈̱ ̥̠͇͎͕̜s̤e̺e̙ͅņ̜ ̲̟͝za̴͖̱̲͈̘l͖̖͓̙̮͔g͕̞͖͘o͕̤͈̗ ̯̲̹̲͓b͙͟e̞͎̜̗͈͉̭͞f̸or̰̩e̡̝̺,̸͕̙̥̼͇̜ ̪͇̹r̘̪ͅị͔̥͈ͅg̠̟̯͖̦͇ht͖̪͍͚̖͡?͙̝͖̞
|
||||
|
||||
|
Binary file not shown.
@ -1,9 +0,0 @@
|
||||
Content-Type|multipart/form-data; boundary="PMyKOsh8JrSZm-rUF8EJej42yqbh-UWw9FG-"
|
||||
Parts-Count|6
|
||||
Part-ContainsContents|pi|3.14159265358979323846264338327950288419716939937510
|
||||
Part-ContainsContents|company|bob & frank's shoe repair
|
||||
Part-ContainsContents|power|ꬵо𝗋ⲥ𝖾
|
||||
Part-ContainsContents|japanese|健治
|
||||
Part-ContainsContents|hello|ャユ戆タ
|
||||
Part-Filename|upload_file|filename
|
||||
Part-Sha1sum|upload_file|e75b73644afe9b234d70da9ff225229de68cdff8
|
@ -1,2 +0,0 @@
|
||||
Content-Type|multipart/form-data; boundary="mToTaXZk2RQZb6TrQRLOgqW-44MPpVbs5wyJTlyl"
|
||||
Parts-Count|10
|
@ -1,4 +0,0 @@
|
||||
Content-Type|multipart/form-data; boundary="CVnTR46ddexmZjsh1ORHg9QbCOiLhUYl"
|
||||
Parts-Count|168
|
||||
Part-ContainsContents|persian-UTF-8|برج بابل
|
||||
Part-ContainsContents|persian-CESU-8|برج بابل
|
@ -1,6 +0,0 @@
|
||||
Content-Type|multipart/form-data; boundary="94GJ2MW4vpjh92qj-CHjUUIwb9X8Y2LqkU2Yxn0vTU2oHy5jk6_Kpxn2aE9EokEiRGox4eWfAYP8-"
|
||||
Parts-Count|4
|
||||
Part-ContainsContents|reporter|<user@company.com>
|
||||
Part-ContainsContents|timestamp|2018-03-21T19:00:18+00:00
|
||||
Part-ContainsContents|comments|this also couldn't be parsed
|
||||
Part-ContainsContents|attachment|cherry
|
@ -1,6 +0,0 @@
|
||||
Content-Type|multipart/form-data; boundary="kCFSwstIsIZkZtQ5JM7193kJYcK5WkyvoxsGjx5eCuVFbaeUZ9oK57JCp_p5wP86S5nY4re5x"
|
||||
Parts-Count|4
|
||||
Part-ContainsContents|reporter|<user@company.com>
|
||||
Part-ContainsContents|timestamp|2018-03-21T18:52:18+00:00
|
||||
Part-ContainsContents|comments|this couldn't be parsed
|
||||
Part-ContainsContents|attachment|banana
|
@ -1,3 +0,0 @@
|
||||
Content-Type|multipart/form-data; boundary="RjYiyHVV9Phv7tYylzT1f94fvTC-s7oNKwB9_Y"
|
||||
Parts-Count|1
|
||||
Part-ContainsContents|pi|3.14159265358979323846264338327950288419716939937510
|
@ -1,3 +0,0 @@
|
||||
Content-Type|multipart/form-data; boundary="P6Uyk-Vikfbk_NqTfVF4DwNXrIxpN451pD1"
|
||||
Parts-Count|1
|
||||
Part-ContainsContents|pi|3.14159265358979323846264338327950288419716939937510
|
@ -1,4 +0,0 @@
|
||||
Content-Type|multipart/form-data; boundary="VA2isIGmYNkgC3qrrGXnlQcWO17WB3a4npVQey"
|
||||
Parts-Count|2
|
||||
Part-ContainsContents|japanese|健治
|
||||
Part-ContainsContents|hello|ャユ戆タ
|
@ -1,5 +0,0 @@
|
||||
Content-Type|multipart/form-data; boundary="tR61vgdxSzzv2FDycET2lt-OUZ1IW1GqA"
|
||||
Parts-Count|4
|
||||
Part-ContainsContents|and "I" quote|Value 1
|
||||
Part-ContainsContents|and+%22I%22+quote|Value 2
|
||||
Part-ContainsContents|value"; what="whoa"|Value 3
|
@ -1,9 +0,0 @@
|
||||
Content-Type|multipart/form-data; boundary="ny9C5eIZL7fsfPY9ONPy8Lxb6tkgEv1"
|
||||
Parts-Count|3
|
||||
Part-ContainsContents|text|text default
|
||||
Part-ContainsContents|file1|Content of a.txt
|
||||
Part-ContainsContents|file2|<!DOCTYPE html><title>Content of a.html
|
||||
Part-Filename|file1|a.txt
|
||||
Part-Filename|file2|a.html
|
||||
Part-Sha1sum|file1|588A0F273CB5AFE9C8D76DD081812E672F2061E2
|
||||
Part-Sha1sum|file2|9A9005159AB90A6D2D9BACB5414EFE932F0CED85
|
@ -1,5 +0,0 @@
|
||||
Content-Type|multipart/form-data; boundary="1R40qTSaEjDJPcArQiccT7vdpp0l02248R"
|
||||
Parts-Count|2
|
||||
Part-ContainsContents|こんにちは世界|Greetings 1
|
||||
Part-ContainsContents|%E3%81%93%E3%82%93%E3%81%AB%E3%81%A1%E3%81%AF%E4%B8%96%E7%95%8C|Greetings 2
|
||||
|
@ -1,5 +0,0 @@
|
||||
Content-Type|multipart/form-data; boundary="qjIkwQOhaYfC2VEcL5j-9sjEK1FIsYMd5"
|
||||
Parts-Count|1
|
||||
Part-ContainsContents|company|bob & frank's shoe repair
|
||||
|
||||
|
@ -170,14 +170,14 @@ public class ResourceHandlerTest
|
||||
assertThat(response.getContent(),containsString("big.txt"));
|
||||
assertThat(response.getContent(),containsString("bigger.txt"));
|
||||
assertThat(response.getContent(),containsString("directory"));
|
||||
assertThat(response.getContent(),containsString("simple.raw"));
|
||||
assertThat(response.getContent(),containsString("simple.txt"));
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testHeaders() throws Exception
|
||||
{
|
||||
HttpTester.Response response = HttpTester.parseResponse(
|
||||
_local.getResponse("GET /resource/simple.raw HTTP/1.0\r\n\r\n"));
|
||||
_local.getResponse("GET /resource/simple.txt HTTP/1.0\r\n\r\n"));
|
||||
assertThat(response.getStatus(),equalTo(200));
|
||||
assertThat(response.get(CONTENT_TYPE),equalTo("text/plain"));
|
||||
assertThat(response.get(LAST_MODIFIED),Matchers.notNullValue());
|
||||
|
Loading…
x
Reference in New Issue
Block a user