This is the mail archive of the
java-prs@sourceware.cygnus.com
mailing list for the Java project.
java.net/169: Falsely claims HTTP/1.1 compliance
- To: java-gnats at sourceware dot cygnus dot com
- Subject: java.net/169: Falsely claims HTTP/1.1 compliance
- From: francis at ecal dot com
- Date: 9 Mar 2000 18:47:03 -0000
- Reply-To: francis at ecal dot com
- Resent-Cc: java-prs at sourceware dot cygnus dot com, green at cygnus dot com
- Resent-Reply-To: java-gnats@sourceware.cygnus.com, francis@ecal.com
>Number: 169
>Category: java.net
>Synopsis: Falsely claims HTTP/1.1 compliance
>Confidential: no
>Severity: serious
>Priority: medium
>Responsible: warrenl
>State: open
>Class: sw-bug
>Submitter-Id: net
>Arrival-Date: Thu Mar 09 10:50:00 PST 2000
>Closed-Date:
>Last-Modified:
>Originator: francis@ecal.com
>Release: unknown-1.0
>Organization:
>Environment:
RedHat 6.1
>Description:
gnu.gcj.protocol.http.Connection tells the server it's
an HTTP/1.1 client, but it isn't; it doesn't support
chunked Transfer-Encoding (or persistent connections, or
pretty much anything else). If you talk to an HTTP/1.1
server (e.g., Apache), and it uses the chunked Transfer-
Encoding, you wind up with the chunking data mixed in
with the response content.
>How-To-Repeat:
Compile and run the attached Java program, which fetches
a PHP-generated URL (a single line, saying "See?"). The
URL is delivered chunked, and so the program prints out
all the chunking information (plus the headers; I'm getting
ready to put in another bug on that).
>Fix:
I hope to work on full 1.1 support; but, in the meantime,
I recommend changing line 97 of
libjava/gnu/gcj/protocol/http/Connection.java to say
"HTTP/1.0" instead of "HTTP/1.1".
>Release-Note:
>Audit-Trail:
>Unformatted:
----gnatsweb-attachment----
Content-Type: application/octet-stream; name="DemonstrateChunked.java"
Content-Transfer-Encoding: base64
Content-Disposition: attachment; filename="DemonstrateChunked.java"
aW1wb3J0IGphdmEubmV0Lio7CmltcG9ydCBqYXZhLmlvLio7CgpwdWJsaWMgY2xhc3MgRGVtb25z
dHJhdGVDaHVua2VkIHsKICAgIHB1YmxpYyBzdGF0aWMgdm9pZCBtYWluKFN0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