|
19 | 19 | import java.io.OutputStream; |
20 | 20 | import java.io.Writer; |
21 | 21 | import java.net.Socket; |
22 | | -import java.net.SocketException; |
23 | 22 | import java.net.URI; |
24 | 23 | import java.net.URLDecoder; |
25 | 24 | import java.net.http.HttpClient; |
|
40 | 39 | import java.util.zip.InflaterInputStream; |
41 | 40 |
|
42 | 41 | import com.inversoft.net.ssl.SSLTools; |
43 | | -import com.inversoft.rest.ByteArrayBodyHandler; |
44 | 42 | import com.inversoft.rest.RESTClient; |
45 | 43 | import com.inversoft.rest.TextResponseHandler; |
46 | 44 | import io.fusionauth.http.HTTPValues.Connections; |
|
55 | 53 | import io.fusionauth.http.server.HTTPServerConfiguration; |
56 | 54 | import org.testng.annotations.Test; |
57 | 55 | import static org.testng.Assert.assertEquals; |
58 | | -import static org.testng.Assert.assertFalse; |
59 | 56 | import static org.testng.Assert.assertNull; |
60 | 57 | import static org.testng.Assert.assertTrue; |
61 | 58 | import static org.testng.Assert.fail; |
@@ -1078,40 +1075,6 @@ public void statusOnly(String scheme) throws Exception { |
1078 | 1075 | } |
1079 | 1076 | } |
1080 | 1077 |
|
1081 | | - @Test |
1082 | | - public void tldr() { |
1083 | | - // Too long did not read |
1084 | | - // - Ues a large body, don't read any of it. Force the server to drain the InputStream and the body length |
1085 | | - // will exceed the configured number of bytes that are 'drainable' causing an exception. This means |
1086 | | - // the socket will be closed and not re-used. |
1087 | | - |
1088 | | - // Ensure the body is larger than the configured max bytes to drain |
1089 | | - var value = "1234567890"; |
1090 | | - var valueLength = ((4 * 1024) / value.length()) + 42; |
1091 | | - var payload = "foo=" + value.repeat(valueLength); |
1092 | | - byte[] bytes = payload.getBytes(StandardCharsets.UTF_8); |
1093 | | - |
1094 | | - HTTPHandler noOpHandler = (req, res) -> { |
1095 | | - }; |
1096 | | - |
1097 | | - // Start the server, configure to only allow 2k of bytes to drain |
1098 | | - try (var ignore = makeServer("http", noOpHandler, null) |
1099 | | - .withMaximumBytesToDrain(2 * 1024) |
1100 | | - .start()) { |
1101 | | - |
1102 | | - URI uri = makeURI("http", ""); |
1103 | | - var response = new RESTClient<>(Void.TYPE, Void.TYPE) |
1104 | | - .url(uri.toString()) |
1105 | | - .bodyHandler(new ByteArrayBodyHandler(bytes)) |
1106 | | - .get() |
1107 | | - .go(); |
1108 | | - |
1109 | | - assertFalse(response.wasSuccessful()); |
1110 | | - // The server will have closed the socket |
1111 | | - assertEquals(response.exception.getClass(), SocketException.class); |
1112 | | - } |
1113 | | - } |
1114 | | - |
1115 | 1078 | @Test |
1116 | 1079 | public void tlsIssues() throws Exception { |
1117 | 1080 | HTTPHandler handler = (req, res) -> { |
|
0 commit comments