ASF Bugzilla – Attachment 25579 Details for
Bug 49424
Using URL.ChunkedStreamingMode results in HTTP response code: 405
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
TestNG unit test to demonstrate the issue.
ApacheChunkedBug.java (text/x-java), 1.22 KB, created by
Earl Nolan
on 2010-06-10 15:42:46 UTC
(
hide
)
Description:
TestNG unit test to demonstrate the issue.
Filename:
MIME Type:
Creator:
Earl Nolan
Created:
2010-06-10 15:42:46 UTC
Size:
1.22 KB
patch
obsolete
>import org.testng.annotations.Test; > >import java.io.IOException; >import java.io.InputStream; >import java.net.HttpURLConnection; >import java.net.URL; > >import static org.testng.AssertJUnit.*; > >/** > * > */ >@Test >public class ApacheChunkedBug { > > // Works on all versions. > public void connectNoChunking() throws IOException { > HttpURLConnection conn = getConnection(); > InputStream is = conn.getInputStream(); > assertNotNull(is); > } > > // Works on 6.0.20 and earlier only - failes on .26 (latest version) > public void connectWithChunking() throws IOException { > HttpURLConnection conn = getConnection(); > conn.setChunkedStreamingMode(8 * 1024); > InputStream is = conn.getInputStream(); > assertNotNull(is); > } > > private HttpURLConnection getConnection() throws IOException { > final String query = "http://tomcat.apache.org/"; > URL postURL; > postURL = new URL(query); > HttpURLConnection conn = (HttpURLConnection) postURL.openConnection(); > > conn.setDoInput(true); > conn.setDoOutput(true); > conn.setUseCaches(false); > conn.setAllowUserInteraction(false); > > return conn; > } >}
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Raw
Actions:
View
Attachments on
bug 49424
:
25578
| 25579