[Httpunit-commit] CVS: httpunit/src/com/meterware/httpunit WebResponse.java,1.40,1.41
Brought to you by:
russgold
|
From: Russell G. <rus...@us...> - 2001-07-23 03:05:33
|
Update of /cvsroot/httpunit/httpunit/src/com/meterware/httpunit
In directory usw-pr-cvs1:/tmp/cvs-serv15976/src/com/meterware/httpunit
Modified Files:
WebResponse.java
Log Message:
From David Karr: corrected handling of 3xx responses
Index: WebResponse.java
===================================================================
RCS file: /cvsroot/httpunit/httpunit/src/com/meterware/httpunit/WebResponse.java,v
retrieving revision 1.40
retrieving revision 1.41
diff -u -r1.40 -r1.41
--- WebResponse.java 2001/07/20 21:04:21 1.40
+++ WebResponse.java 2001/07/23 03:05:30 1.41
@@ -220,6 +220,7 @@
* Returns a buffered input stream for reading the contents of this reply.
**/
public InputStream getInputStream() throws IOException {
+ if (_inputStream == null) _inputStream = new ByteArrayInputStream( new byte[0] );
return _inputStream;
}
@@ -482,7 +483,7 @@
if (_responseText != null) throw new IllegalStateException( "May only invoke loadResponseText once" );
_responseText = "";
- InputStream inputStream = _inputStream;
+ InputStream inputStream = getInputStream();
try {
ByteArrayOutputStream outputStream = new ByteArrayOutputStream();
byte[] buffer = new byte[8 * 1024];
|