Contents
There were a number of bugs in the initial release of Version 0.3
which are fixed in this bug fix release:
- Bug in RedirectionModule fixed: a server redirecting to a new
host name which mapped to the same IP-address as the old host
name would be infinitely redirected.
- The RedirectionModule was not doing the redirects properly when
redirected to a new non IP-based virtual host (it was trying to
be too smart).
- URL parameters were being propagated in the RedirectionModule when
they shouldn't be touched.
- The context was not preserved when redirecting (i.e the new
HTTPConnection was always using the default context).
- Redirection bugs in HttpURLConnection fixed.
- HttpURLConnection.getHeaderField(0)
now returns the response status line;
HttpURLConnection.getHeaderFieldKey(0)
returns null. This is undocumented, but the JDK 1.1.x and JDK 1.2
behave that way.
- Problem concerning firewalls in HttpURLConnection fixed: if you
were behind a firewall and using a proxy to reach hosts for
which you were unable to resolve the host name (as is often
the case behind firewalls for hosts outside the firewall) then
the constructor would throw an UnknownHostException. This fix
also fixes problems when talking to non IP-based virtual hosts.
- Cookie parser assumed weekday in expires attribute was 3 chars
(as per spec); it now also handles non-abbreviated weekdays
- Cookie header parsing had a bug which could generate an
ArrayOutOfBoundsException.
- IdempotentSequence fixed
- Invoking HTTPConnection.stop() could cause a NullPointerException
in StreamDemultiplexor.java.
- EstablishConnection (defined in HTTPConnection.java) would get
a NullPointerException if a Timeout was set and the connection
failed after that.
- only Content-type: multipart/byteranges was recognized;
Content-type: multipart/x-byteranges was not due to a typo.
- requestHandler invocation fixed - previously you couldn't return
a new response. Also, public constructor added to Response so
that a finished response can be created.
- AuthorizationInfo: the realm was being trim()'d everywhere, which
of course screwed up if your realm really started or ended with
whitespace. Therefore, the trim()'s have been removed.
- ContentEncoding module was only sending the tokens gzip
and compress; it now also send x-gzip and
x-compress (in addition)
- Starting with JDK 1.2 Final java.util.zip.InflaterInputStream
throws a NullPointerException in if passed a null stream.
TransferEncodingModule.java and ContentEncodingModule.java now
catch that.
- Util.httpDate() now
generates dates correctly when the default Locale isn't "en" (i.e US,
UK, etc).
- TokenChar in Util was not defined correctly (included 128-255)
- Kludge in Util.findStr() to work around VJ++ - this was in V0.2-3,
but somehow didn't make it into V0.3
- Constructor HttpHeaderElement(String, String, NVPair[])
didn't make a copy of the NVPair[].
A number of enhancements and workarounds for buggy servers/scripts
have been incorporated into this bug fix too:
- HttpHeaderElement.toString()
now only quotes if necessary
- New setInstanceFollowRedirects()
and getInstanceFollowRedirects()
methods added to HttpURLConnection
to control redirection for the specific instance only.
- Entity delimiter selection now updated to conform to HTTP/1.1-Rev.6
(Transfer-Encoding adjustments)
- Cookie2 class updated to rev-10 of the state management draft
(introduction of the .local domain).
- Cookie policy popup updated to handle Cookie2 requests
- Proxy-Connection header is correctly stripped when necessary
- Minor hack for HotJava: if HttpURLConnection is running under
HotJava then invoking getResponseCode() will also do a
HTTPResponse.getData() if the status code is an error (>= 300).
HotJava has the nasty habit of not picking up its data.
- HttpURLConnection now also reads the properties nonProxyHosts
and http.proxyHost each time an instance is created;
previously these were only read by HTTPConnection at class
initialization time.
- Digest Authentication handler updated to latest spec
(draft-ietf-http-authentication-03.txt). Fully backwards compliant
with rfc-2069.
- Response header parser loosened a bit; it will now parse and accept
invalid headers of the form "name value" (i.e. missing `:').
- Cookie and Cookie2 parsers loosened a bit; previously domain
attributes always had a dot prepended to them if they didn't
already start with one. This is to prevent unwanted sharing of
cookies between domains having similar names. However, in some
cases the server set the domain attribute to be the same as the
servers FQDN. When a dot was then prepended the domain attribute
didn't tail match the servers FQDN anymore. Therefore this
situation has been special-cased to not prepend a dot.
- An invalid expires attribute in a Set-Cookie header is now ignored
(i.e. treated as if there were no expires), instead of throwing
a ProtocolException as was done previously.
- Cookie parser changed with respect to accepting domain attributes.
Previously, it followed Netscape's cookie spec which included the
2/3 dot rule. Because this doesn't work well for many countries
the rules have been changed to those used in Cookie2 (which also
have their problems, but are certainly better).
- The boundary parameter in Codecs.mpFormDataEncode() now does not
quote the value part, i.e. instead of using
Content-type: multipart/form-data; boundary="---....--"
it now uses
Content-type: multipart/form-data; boundary=---....--
This is because there are just too many broken parsers out there
which can't handle the parameter value being quoted. This is
especially galling as RFC-2046 *recommends* the value be quoted.
- Codecs: mpFormDataEncode() does not print the leading CR LR
anymore - some (broken) parsers couldn't handle a preamble.
- Codecs: new overloaded versions of
mpFormDataEncode() and
mpFormDataDecode()
are available which take a
FilenameMangler
as an additional argument. This mangler can be used to control
the names of the resulting files stored, and the names put into
the encoded data.
- Only a single timeout thread is now used - it is shared by all
connections. This should be a little more efficient...
- new URI class added. This
class parses URLs correctly and implements correct equals(), but
most importantly it does not require a URLStreamHandler to exist
for the scheme. The client now uses URI internally instead of
java.net.URL .
- Added getOriginalURI()
and getEffectiveURI()
to HTTPResponse.
These both return URI's, and getEffectiveURI() returns the same as
getOriginalURI() when no redirection took place (- to check for
redirection, use
if (resp.getEffective() != resp.getOriginalURL())
- CookieModule has
three new methods: listAllCookies(),
which will return an array of all the currently stored cookies,
addCookie()
to add a cookie to the list, and
removeCookie()
to remove a Cookie. In addition, the
Cookie and
Cookie2 classes each have a
new public constructor.
- Access to cookie lists now properly synchronized
- Cookie may be saved and loaded again at startup by setting the
new system property HTTPClient.cookies.save too
true. The file used for saving files may be specified
in the system property HTTPClient.cookies.jar; if this
property is not set a system dependent name is chosen.
- AuthorizationInfo
has two new methods:
getCookie()
and
setCookie().
These manipulate the "cookie" when the simple form of the WWW-Authenticate
and Authorization headers is used.
- Parser and Realm attribute treatment loosened in AuthorizationInfo
to allow for schemes which don't use the Realm.
- AuthorizationInfo better documented, especially concerning the
various fields and their uses.
V0.3-1 should be plug-in compatible with V0.3. I.e. no changes to
your code are required unless you wish to make use of some of the new
features.
Ronald Tschalär / 10. February 1999 /
ronald@innovation.ch.