From commits-return-61485-apmail-harmony-commits-archive=harmony.apache.org@harmony.apache.org Wed Feb 17 23:01:57 2010 Return-Path: Delivered-To: apmail-harmony-commits-archive@www.apache.org Received: (qmail 70532 invoked from network); 17 Feb 2010 23:01:57 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 17 Feb 2010 23:01:57 -0000 Received: (qmail 29126 invoked by uid 500); 17 Feb 2010 23:01:57 -0000 Delivered-To: apmail-harmony-commits-archive@harmony.apache.org Received: (qmail 29065 invoked by uid 500); 17 Feb 2010 23:01:57 -0000 Mailing-List: contact commits-help@harmony.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@harmony.apache.org Delivered-To: mailing list commits@harmony.apache.org Received: (qmail 29056 invoked by uid 99); 17 Feb 2010 23:01:57 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 17 Feb 2010 23:01:57 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.140] (HELO brutus.apache.org) (140.211.11.140) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 17 Feb 2010 23:01:50 +0000 Received: from brutus.apache.org (localhost [127.0.0.1]) by brutus.apache.org (Postfix) with ESMTP id 09807234C48C for ; Wed, 17 Feb 2010 15:01:29 -0800 (PST) Message-ID: <1191860334.345801266447689037.JavaMail.jira@brutus.apache.org> Date: Wed, 17 Feb 2010 23:01:29 +0000 (UTC) From: "Michael Andresen (JIRA)" To: commits@harmony.apache.org Subject: [jira] Created: (HARMONY-6452) HttpUrlConnection converts request headers to lowercase - HttpUrlConnection.addRequestProperty overrides existing properties MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 X-Virus-Checked: Checked by ClamAV on apache.org HttpUrlConnection converts request headers to lowercase - HttpUrlConnection.addRequestProperty overrides existing properties ---------------------------------------------------------------------------------------------------------------------------- Key: HARMONY-6452 URL: https://issues.apache.org/jira/browse/HARMONY-6452 Project: Harmony Issue Type: Bug Components: Classlib Environment: Android 1.6 Reporter: Michael Andresen Problem: Lower-Case-Headers ============================== In Sun's JRE this code java.net.HttpURLConnection conn = (java.net.HttpURLConnection)(new java.net.URL("http://...").openConnection()); conn.setRequestProperty("Content-Type", "multipart/form-data; boundary=..."); System.out.println (conn.getRequestProperty("content-type")); System.out.println (conn.getRequestProperties()); produces the following output: multipart/form-data; boundary=... {Content-Type=[multipart/form-data; boundary=...]} The Property-Name "Content-Type" is stored case sensitive but it can be fetched in lower-case. The resulting Request-Header sent to the Web-Server is case sensitive. On Android 1.6 (which uses Apache Harmony) the same Code produces the following output: multipart/form-data; boundary=... {content-type=[multipart/form-data; boundary=...]} This time the Property-Name "Content-Type" is stored in lower-case. The resulting Request-Header is also sent in lower-case. That's a violation of the HTTP 1.1 spec, and certain service providers may ignore such Request-Headers. In harmony 5.0 r901653 the output is the same as on Android 1.6 but the resulting Request-Header is sent case-sensitive. Problem addRequestProperty overrides existing properties ============================================== Existing Properties should be appended. Info ============================================== The class org.apache.harmony.luni.internal.net.www.protocol.http.Header is not correct implemented. It only works with lower-case property-names and each property-value can only contain one entry. Question ============================== 1. Does anybody know how to find out which version of harmony is used by Android 1.6? I tried System.getProperties() but that didn't help. 2. I would like to attach a patch to this issue but I don't know how? Simply copy it into the Description? Is there a File-Upload? -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.