You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@harmony.apache.org by "Michael Andresen (JIRA)" <ji...@apache.org> on 2010/02/18 00:01:29 UTC

[jira] Created: (HARMONY-6452) HttpUrlConnection converts request headers to lowercase - HttpUrlConnection.addRequestProperty overrides existing properties

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.


[jira] Updated: (HARMONY-6452) HttpUrlConnection converts request headers to lowercase - HttpUrlConnection.addRequestProperty overrides existing properties

Posted by "Michael Andresen (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/HARMONY-6452?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Michael Andresen updated HARMONY-6452:
--------------------------------------

    Patch Info: [Patch Available]

> 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
>            Assignee: Mark Hindess
>         Attachments: descriptions.txt, Header.java
>
>
> 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.
> Example
> ==============================================
> 	HttpURLConnection conn = (HttpURLConnection)(new URL("http://www.example.com/index.html").openConnection());
> 	conn.setRequestProperty("Content-Disposition", "Content-Disposition: form-data");
> 	conn.addRequestProperty("Content-Disposition", "name=\"file\"");
> 	conn.addRequestProperty("Content-Disposition", "filename=\"test.html\"");
> 	conn.setRequestProperty("a", "1");
> 	conn.addRequestProperty("a", "2");
> 	System.out.println ("Single Property: "+conn.getRequestProperty("content-disposition"));
> 	System.out.println ("All Properties:");
> 	for (Map.Entry<String, List<String>> entry : conn.getRequestProperties().entrySet()) {
> 		System.out.print ("  Property: "+entry.getKey()+" = {");
> 		for (String v : entry.getValue())
> 			System.out.print (v+";");
> 		System.out.println ("}");
> 	}
> Should produce the following output:
> 	Single Property: filename="test.html"
> 	All Properties:
> 	  Property: a = {2;1;}
> 	  Property: Content-Disposition = {filename="test.html";name="file";Content-Disposition: form-data;}
> But the following output is produced:
> 	Single Property: filename="test.html"
> 	All Properties:
> 	  Property: content-disposition = {filename="test.html";}
> 	  Property: a = {2;}
> I have set the Property "a" in lower-case to make clear, that this problem is depends on the lower-case headers problem.
> 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.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (HARMONY-6452) HttpUrlConnection converts request headers to lowercase - HttpUrlConnection.addRequestProperty overrides existing properties

Posted by "Hudson (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HARMONY-6452?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12836383#action_12836383 ] 

Hudson commented on HARMONY-6452:
---------------------------------

Integrated in Harmony-1.5-head-linux-x86_64 #645 (See [http://hudson.zones.apache.org/hudson/job/Harmony-1.5-head-linux-x86_64/645/])
    Add regression tests and fix remaining issues from "[#]
HttpUrlConnection converts request headers to lowercase ...".


> 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
>            Assignee: Mark Hindess
>             Fix For: 6.0M1, 5.0M13
>
>         Attachments: descriptions.txt, Header.java
>
>
> 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.
> Example
> ==============================================
> 	HttpURLConnection conn = (HttpURLConnection)(new URL("http://www.example.com/index.html").openConnection());
> 	conn.setRequestProperty("Content-Disposition", "Content-Disposition: form-data");
> 	conn.addRequestProperty("Content-Disposition", "name=\"file\"");
> 	conn.addRequestProperty("Content-Disposition", "filename=\"test.html\"");
> 	conn.setRequestProperty("a", "1");
> 	conn.addRequestProperty("a", "2");
> 	System.out.println ("Single Property: "+conn.getRequestProperty("content-disposition"));
> 	System.out.println ("All Properties:");
> 	for (Map.Entry<String, List<String>> entry : conn.getRequestProperties().entrySet()) {
> 		System.out.print ("  Property: "+entry.getKey()+" = {");
> 		for (String v : entry.getValue())
> 			System.out.print (v+";");
> 		System.out.println ("}");
> 	}
> Should produce the following output:
> 	Single Property: filename="test.html"
> 	All Properties:
> 	  Property: a = {2;1;}
> 	  Property: Content-Disposition = {filename="test.html";name="file";Content-Disposition: form-data;}
> But the following output is produced:
> 	Single Property: filename="test.html"
> 	All Properties:
> 	  Property: content-disposition = {filename="test.html";}
> 	  Property: a = {2;}
> I have set the Property "a" in lower-case to make clear, that this problem is depends on the lower-case headers problem.
> 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.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (HARMONY-6452) HttpUrlConnection converts request headers to lowercase - HttpUrlConnection.addRequestProperty overrides existing properties

Posted by "Mark Hindess (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HARMONY-6452?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12835928#action_12835928 ] 

Mark Hindess commented on HARMONY-6452:
---------------------------------------

Michael, thanks for your suggested fix.  It is preferable to submit a patch rather than a complete replacement - see http://harmony.apache.org/get-involved.html#Guidelines%20on%20how%20to%20Create%20and%20Submit%20a%20Patch - but I'm happy to work with the attached copy for now.

With your patch some simple cases seem to produce odd behaviour, such as:

        conn.setRequestProperty("KEY", "upper");
        conn.setRequestProperty("key", "lower");
        System.out.println("KEY=" + conn.getRequestProperty("KEY"));
        System.out.println("key=" + conn.getRequestProperty("key"));
        System.out.println("properties=" + conn.getRequestProperties()); 

produces output:

   KEY=lower
   key=lower
   properties={KEY=[upper]}

and also:

        conn.setRequestProperty("key", "lower");
        conn.setRequestProperty("KEY", "upper");
        System.out.println("KEY=" + conn.getRequestProperty("KEY"));
        System.out.println("key=" + conn.getRequestProperty("key"));
        System.out.println("properties=" + conn.getRequestProperties()); 

produces:

  KEY=upper
  key=upper
  properties={KEY=[upper], key=[lower]}

So it is still not quite right.  Having said that, I wonder if perhaps we are aiming for the wrong solution here.  The reference implementation seems rather inconsistent so I wonder if it is really worth trying to match its behaviour other than meeting the spec.

I've raised this on the dev list to try to get consensus on the way to fix this and to see if anyone can makes sense of the reference implementation behaviour.  See:

  http://markmail.org/thread/3lyqkyg3oxyeithc

Please join that discussion and we can summarize any conclusions on this JIRA.  In the meantime, I'll continue to investigate.




> 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
>            Assignee: Mark Hindess
>         Attachments: descriptions.txt, Header.java
>
>
> 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.
> Example
> ==============================================
> 	HttpURLConnection conn = (HttpURLConnection)(new URL("http://www.example.com/index.html").openConnection());
> 	conn.setRequestProperty("Content-Disposition", "Content-Disposition: form-data");
> 	conn.addRequestProperty("Content-Disposition", "name=\"file\"");
> 	conn.addRequestProperty("Content-Disposition", "filename=\"test.html\"");
> 	conn.setRequestProperty("a", "1");
> 	conn.addRequestProperty("a", "2");
> 	System.out.println ("Single Property: "+conn.getRequestProperty("content-disposition"));
> 	System.out.println ("All Properties:");
> 	for (Map.Entry<String, List<String>> entry : conn.getRequestProperties().entrySet()) {
> 		System.out.print ("  Property: "+entry.getKey()+" = {");
> 		for (String v : entry.getValue())
> 			System.out.print (v+";");
> 		System.out.println ("}");
> 	}
> Should produce the following output:
> 	Single Property: filename="test.html"
> 	All Properties:
> 	  Property: a = {2;1;}
> 	  Property: Content-Disposition = {filename="test.html";name="file";Content-Disposition: form-data;}
> But the following output is produced:
> 	Single Property: filename="test.html"
> 	All Properties:
> 	  Property: content-disposition = {filename="test.html";}
> 	  Property: a = {2;}
> I have set the Property "a" in lower-case to make clear, that this problem is depends on the lower-case headers problem.
> 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.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (HARMONY-6452) HttpUrlConnection converts request headers to lowercase - HttpUrlConnection.addRequestProperty overrides existing properties

Posted by "Hudson (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HARMONY-6452?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12836293#action_12836293 ] 

Hudson commented on HARMONY-6452:
---------------------------------

Integrated in Harmony-1.5-head-linux-x86_64 #644 (See [http://hudson.zones.apache.org/hudson/job/Harmony-1.5-head-linux-x86_64/644/])
    Fix for item 1 from descriptions.txt of "[#] HttpUrlConnection
converts request headers to lowercase ...".  The props list corruption.


> 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
>            Assignee: Mark Hindess
>         Attachments: descriptions.txt, Header.java
>
>
> 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.
> Example
> ==============================================
> 	HttpURLConnection conn = (HttpURLConnection)(new URL("http://www.example.com/index.html").openConnection());
> 	conn.setRequestProperty("Content-Disposition", "Content-Disposition: form-data");
> 	conn.addRequestProperty("Content-Disposition", "name=\"file\"");
> 	conn.addRequestProperty("Content-Disposition", "filename=\"test.html\"");
> 	conn.setRequestProperty("a", "1");
> 	conn.addRequestProperty("a", "2");
> 	System.out.println ("Single Property: "+conn.getRequestProperty("content-disposition"));
> 	System.out.println ("All Properties:");
> 	for (Map.Entry<String, List<String>> entry : conn.getRequestProperties().entrySet()) {
> 		System.out.print ("  Property: "+entry.getKey()+" = {");
> 		for (String v : entry.getValue())
> 			System.out.print (v+";");
> 		System.out.println ("}");
> 	}
> Should produce the following output:
> 	Single Property: filename="test.html"
> 	All Properties:
> 	  Property: a = {2;1;}
> 	  Property: Content-Disposition = {filename="test.html";name="file";Content-Disposition: form-data;}
> But the following output is produced:
> 	Single Property: filename="test.html"
> 	All Properties:
> 	  Property: content-disposition = {filename="test.html";}
> 	  Property: a = {2;}
> I have set the Property "a" in lower-case to make clear, that this problem is depends on the lower-case headers problem.
> 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.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Resolved: (HARMONY-6452) HttpUrlConnection converts request headers to lowercase - HttpUrlConnection.addRequestProperty overrides existing properties

Posted by "Mark Hindess (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/HARMONY-6452?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Mark Hindess resolved HARMONY-6452.
-----------------------------------

       Resolution: Fixed
    Fix Version/s: 5.0M13
                   6.0M1

I've committed fixes and regression tests for all the issues covered by this JIRA in r912351.  Thanks to elliot for his input on the dev@ list.

Michael, I didn't use your fix but I think I've covered everything with the two commits.  Can you confirm that this is the case by closing this JIRA.  (Or add further comments if I've missed something.)

Many thanks,
 Mark.

> 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
>            Assignee: Mark Hindess
>             Fix For: 6.0M1, 5.0M13
>
>         Attachments: descriptions.txt, Header.java
>
>
> 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.
> Example
> ==============================================
> 	HttpURLConnection conn = (HttpURLConnection)(new URL("http://www.example.com/index.html").openConnection());
> 	conn.setRequestProperty("Content-Disposition", "Content-Disposition: form-data");
> 	conn.addRequestProperty("Content-Disposition", "name=\"file\"");
> 	conn.addRequestProperty("Content-Disposition", "filename=\"test.html\"");
> 	conn.setRequestProperty("a", "1");
> 	conn.addRequestProperty("a", "2");
> 	System.out.println ("Single Property: "+conn.getRequestProperty("content-disposition"));
> 	System.out.println ("All Properties:");
> 	for (Map.Entry<String, List<String>> entry : conn.getRequestProperties().entrySet()) {
> 		System.out.print ("  Property: "+entry.getKey()+" = {");
> 		for (String v : entry.getValue())
> 			System.out.print (v+";");
> 		System.out.println ("}");
> 	}
> Should produce the following output:
> 	Single Property: filename="test.html"
> 	All Properties:
> 	  Property: a = {2;1;}
> 	  Property: Content-Disposition = {filename="test.html";name="file";Content-Disposition: form-data;}
> But the following output is produced:
> 	Single Property: filename="test.html"
> 	All Properties:
> 	  Property: content-disposition = {filename="test.html";}
> 	  Property: a = {2;}
> I have set the Property "a" in lower-case to make clear, that this problem is depends on the lower-case headers problem.
> 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.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (HARMONY-6452) HttpUrlConnection converts request headers to lowercase - HttpUrlConnection.addRequestProperty overrides existing properties

Posted by "Michael Andresen (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/HARMONY-6452?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Michael Andresen updated HARMONY-6452:
--------------------------------------

    Description: 
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.

Example
==============================================
	HttpURLConnection conn = (HttpURLConnection)(new URL("http://www.example.com/index.html").openConnection());
	conn.setRequestProperty("content-disposition", "Content-Disposition: form-data");
	conn.addRequestProperty("content-disposition", "name=\"file\"");
	conn.addRequestProperty("content-disposition", "filename=\"test.html\"");
	conn.setRequestProperty("a", "1");
	conn.addRequestProperty("a", "2");
	System.out.println ("Single Property: "+conn.getRequestProperty("content-disposition"));
	System.out.println ("All Properties:");
	for (Map.Entry<String, List<String>> entry : conn.getRequestProperties().entrySet()) {
		System.out.print ("  Property: "+entry.getKey()+" = {");
		for (String v : entry.getValue())
			System.out.print (v+";");
		System.out.println ("}");
	}
Should produce the following output:
	Single Property: filename="test.html"
	All Properties:
	  Property: a = {2;1;}
	  Property: content-disposition = {filename="test.html";name="file";Content-Disposition: form-data;}
But the following output is produced:
	Single Property: filename="test.html"
	All Properties:
	  Property: content-disposition = {filename="test.html";}
	  Property: a = {2;}
I have set the Property "Content-Disposition" in lower-case to make clear, that this problem is independent of the lower-case headers problem.


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.


  was:
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?


- Added an example for the replaced property problem
- Removed the question howto attach a patch file - thanks to Mark Hindess

> 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
>            Assignee: Mark Hindess
>
> 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.
> Example
> ==============================================
> 	HttpURLConnection conn = (HttpURLConnection)(new URL("http://www.example.com/index.html").openConnection());
> 	conn.setRequestProperty("content-disposition", "Content-Disposition: form-data");
> 	conn.addRequestProperty("content-disposition", "name=\"file\"");
> 	conn.addRequestProperty("content-disposition", "filename=\"test.html\"");
> 	conn.setRequestProperty("a", "1");
> 	conn.addRequestProperty("a", "2");
> 	System.out.println ("Single Property: "+conn.getRequestProperty("content-disposition"));
> 	System.out.println ("All Properties:");
> 	for (Map.Entry<String, List<String>> entry : conn.getRequestProperties().entrySet()) {
> 		System.out.print ("  Property: "+entry.getKey()+" = {");
> 		for (String v : entry.getValue())
> 			System.out.print (v+";");
> 		System.out.println ("}");
> 	}
> Should produce the following output:
> 	Single Property: filename="test.html"
> 	All Properties:
> 	  Property: a = {2;1;}
> 	  Property: content-disposition = {filename="test.html";name="file";Content-Disposition: form-data;}
> But the following output is produced:
> 	Single Property: filename="test.html"
> 	All Properties:
> 	  Property: content-disposition = {filename="test.html";}
> 	  Property: a = {2;}
> I have set the Property "Content-Disposition" in lower-case to make clear, that this problem is independent of the lower-case headers problem.
> 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.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (HARMONY-6452) HttpUrlConnection converts request headers to lowercase - HttpUrlConnection.addRequestProperty overrides existing properties

Posted by "Michael Andresen (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/HARMONY-6452?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Michael Andresen updated HARMONY-6452:
--------------------------------------

    Description: 
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.

Example
==============================================
	HttpURLConnection conn = (HttpURLConnection)(new URL("http://www.example.com/index.html").openConnection());
	conn.setRequestProperty("Content-Disposition", "Content-Disposition: form-data");
	conn.addRequestProperty("Content-Disposition", "name=\"file\"");
	conn.addRequestProperty("Content-Disposition", "filename=\"test.html\"");
	conn.setRequestProperty("a", "1");
	conn.addRequestProperty("a", "2");
	System.out.println ("Single Property: "+conn.getRequestProperty("content-disposition"));
	System.out.println ("All Properties:");
	for (Map.Entry<String, List<String>> entry : conn.getRequestProperties().entrySet()) {
		System.out.print ("  Property: "+entry.getKey()+" = {");
		for (String v : entry.getValue())
			System.out.print (v+";");
		System.out.println ("}");
	}
Should produce the following output:
	Single Property: filename="test.html"
	All Properties:
	  Property: a = {2;1;}
	  Property: Content-Disposition = {filename="test.html";name="file";Content-Disposition: form-data;}
But the following output is produced:
	Single Property: filename="test.html"
	All Properties:
	  Property: content-disposition = {filename="test.html";}
	  Property: a = {2;}
I have set the Property "a" in lower-case to make clear, that this problem is depends on the lower-case headers problem.


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.


  was:
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.

Example
==============================================
	HttpURLConnection conn = (HttpURLConnection)(new URL("http://www.example.com/index.html").openConnection());
	conn.setRequestProperty("content-disposition", "Content-Disposition: form-data");
	conn.addRequestProperty("content-disposition", "name=\"file\"");
	conn.addRequestProperty("content-disposition", "filename=\"test.html\"");
	conn.setRequestProperty("a", "1");
	conn.addRequestProperty("a", "2");
	System.out.println ("Single Property: "+conn.getRequestProperty("content-disposition"));
	System.out.println ("All Properties:");
	for (Map.Entry<String, List<String>> entry : conn.getRequestProperties().entrySet()) {
		System.out.print ("  Property: "+entry.getKey()+" = {");
		for (String v : entry.getValue())
			System.out.print (v+";");
		System.out.println ("}");
	}
Should produce the following output:
	Single Property: filename="test.html"
	All Properties:
	  Property: a = {2;1;}
	  Property: content-disposition = {filename="test.html";name="file";Content-Disposition: form-data;}
But the following output is produced:
	Single Property: filename="test.html"
	All Properties:
	  Property: content-disposition = {filename="test.html";}
	  Property: a = {2;}
I have set the Property "Content-Disposition" in lower-case to make clear, that this problem is independent of the lower-case headers problem.


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.



Sorry, the replaced-property-problem only occurs when the property-name is mixed case. I've update the example.

> 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
>            Assignee: Mark Hindess
>
> 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.
> Example
> ==============================================
> 	HttpURLConnection conn = (HttpURLConnection)(new URL("http://www.example.com/index.html").openConnection());
> 	conn.setRequestProperty("Content-Disposition", "Content-Disposition: form-data");
> 	conn.addRequestProperty("Content-Disposition", "name=\"file\"");
> 	conn.addRequestProperty("Content-Disposition", "filename=\"test.html\"");
> 	conn.setRequestProperty("a", "1");
> 	conn.addRequestProperty("a", "2");
> 	System.out.println ("Single Property: "+conn.getRequestProperty("content-disposition"));
> 	System.out.println ("All Properties:");
> 	for (Map.Entry<String, List<String>> entry : conn.getRequestProperties().entrySet()) {
> 		System.out.print ("  Property: "+entry.getKey()+" = {");
> 		for (String v : entry.getValue())
> 			System.out.print (v+";");
> 		System.out.println ("}");
> 	}
> Should produce the following output:
> 	Single Property: filename="test.html"
> 	All Properties:
> 	  Property: a = {2;1;}
> 	  Property: Content-Disposition = {filename="test.html";name="file";Content-Disposition: form-data;}
> But the following output is produced:
> 	Single Property: filename="test.html"
> 	All Properties:
> 	  Property: content-disposition = {filename="test.html";}
> 	  Property: a = {2;}
> I have set the Property "a" in lower-case to make clear, that this problem is depends on the lower-case headers problem.
> 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.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (HARMONY-6452) HttpUrlConnection converts request headers to lowercase - HttpUrlConnection.addRequestProperty overrides existing properties

Posted by "Elliott Hughes (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HARMONY-6452?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12835355#action_12835355 ] 

Elliott Hughes commented on HARMONY-6452:
-----------------------------------------

see also http://code.google.com/p/android/issues/detail?id=6684. i've fixed the case problem in Android, but still need to fill out the Apache paperwork.

the submitter didn't give an example of "each property-value can only contain one entry" which, unlike the case problem, isn't obviously true.

> 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
>            Assignee: Mark Hindess
>
> 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.


[jira] Assigned: (HARMONY-6452) HttpUrlConnection converts request headers to lowercase - HttpUrlConnection.addRequestProperty overrides existing properties

Posted by "Mark Hindess (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/HARMONY-6452?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Mark Hindess reassigned HARMONY-6452:
-------------------------------------

    Assignee: Mark Hindess

On the left of the web page for this JIRA, there should be an "Attach file" item under the "Operations" section on the left-hand side.  You should use this to attach a patch ... be sure to tick the "Grant license to ASF for inclusion in ASF works" in order that we may use your contribution and it might be an idea to read:

  http://harmony.apache.org/contribution_policy.html

Thanks,
 Mark


> 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
>            Assignee: Mark Hindess
>
> 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.


[jira] Updated: (HARMONY-6452) HttpUrlConnection converts request headers to lowercase - HttpUrlConnection.addRequestProperty overrides existing properties

Posted by "Michael Andresen (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/HARMONY-6452?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Michael Andresen updated HARMONY-6452:
--------------------------------------

    Attachment: Header.java
                descriptions.txt

I attached two files:
Header.java:
==========
This file contains the class org.apache.harmony.luni.internal.net.www.protocol.http.Header.
I fixed all bugs in it so that the problems regarding this are solved.

Descriptions:
===========
Documentation about what I've changed compared to the original Header-Class.




> 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
>            Assignee: Mark Hindess
>         Attachments: descriptions.txt, Header.java
>
>
> 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.
> Example
> ==============================================
> 	HttpURLConnection conn = (HttpURLConnection)(new URL("http://www.example.com/index.html").openConnection());
> 	conn.setRequestProperty("Content-Disposition", "Content-Disposition: form-data");
> 	conn.addRequestProperty("Content-Disposition", "name=\"file\"");
> 	conn.addRequestProperty("Content-Disposition", "filename=\"test.html\"");
> 	conn.setRequestProperty("a", "1");
> 	conn.addRequestProperty("a", "2");
> 	System.out.println ("Single Property: "+conn.getRequestProperty("content-disposition"));
> 	System.out.println ("All Properties:");
> 	for (Map.Entry<String, List<String>> entry : conn.getRequestProperties().entrySet()) {
> 		System.out.print ("  Property: "+entry.getKey()+" = {");
> 		for (String v : entry.getValue())
> 			System.out.print (v+";");
> 		System.out.println ("}");
> 	}
> Should produce the following output:
> 	Single Property: filename="test.html"
> 	All Properties:
> 	  Property: a = {2;1;}
> 	  Property: Content-Disposition = {filename="test.html";name="file";Content-Disposition: form-data;}
> But the following output is produced:
> 	Single Property: filename="test.html"
> 	All Properties:
> 	  Property: content-disposition = {filename="test.html";}
> 	  Property: a = {2;}
> I have set the Property "a" in lower-case to make clear, that this problem is depends on the lower-case headers problem.
> 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.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (HARMONY-6452) HttpUrlConnection converts request headers to lowercase - HttpUrlConnection.addRequestProperty overrides existing properties

Posted by "Mark Hindess (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HARMONY-6452?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12836285#action_12836285 ] 

Mark Hindess commented on HARMONY-6452:
---------------------------------------

I've committed a fix (and regression test) for item 1 from your descriptions.txt file in r912259.  As elliott suggested on the dev@harmony.apache.org mailing list in the above thread, I think using a TreeMap(String.CASE_INSENSITIVE_ORDER) will be most consistent solution for the other problems (and it fixes the inconsistency I mention above with your patch).  I'll commit that change too soon.


> 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
>            Assignee: Mark Hindess
>         Attachments: descriptions.txt, Header.java
>
>
> 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.
> Example
> ==============================================
> 	HttpURLConnection conn = (HttpURLConnection)(new URL("http://www.example.com/index.html").openConnection());
> 	conn.setRequestProperty("Content-Disposition", "Content-Disposition: form-data");
> 	conn.addRequestProperty("Content-Disposition", "name=\"file\"");
> 	conn.addRequestProperty("Content-Disposition", "filename=\"test.html\"");
> 	conn.setRequestProperty("a", "1");
> 	conn.addRequestProperty("a", "2");
> 	System.out.println ("Single Property: "+conn.getRequestProperty("content-disposition"));
> 	System.out.println ("All Properties:");
> 	for (Map.Entry<String, List<String>> entry : conn.getRequestProperties().entrySet()) {
> 		System.out.print ("  Property: "+entry.getKey()+" = {");
> 		for (String v : entry.getValue())
> 			System.out.print (v+";");
> 		System.out.println ("}");
> 	}
> Should produce the following output:
> 	Single Property: filename="test.html"
> 	All Properties:
> 	  Property: a = {2;1;}
> 	  Property: Content-Disposition = {filename="test.html";name="file";Content-Disposition: form-data;}
> But the following output is produced:
> 	Single Property: filename="test.html"
> 	All Properties:
> 	  Property: content-disposition = {filename="test.html";}
> 	  Property: a = {2;}
> I have set the Property "a" in lower-case to make clear, that this problem is depends on the lower-case headers problem.
> 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.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Closed: (HARMONY-6452) HttpUrlConnection converts request headers to lowercase - HttpUrlConnection.addRequestProperty overrides existing properties

Posted by "Michael Andresen (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/HARMONY-6452?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Michael Andresen closed HARMONY-6452.
-------------------------------------


Works great!

Thanks

> 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
>            Assignee: Mark Hindess
>             Fix For: 6.0M1, 5.0M13
>
>         Attachments: descriptions.txt, Header.java
>
>
> 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.
> Example
> ==============================================
> 	HttpURLConnection conn = (HttpURLConnection)(new URL("http://www.example.com/index.html").openConnection());
> 	conn.setRequestProperty("Content-Disposition", "Content-Disposition: form-data");
> 	conn.addRequestProperty("Content-Disposition", "name=\"file\"");
> 	conn.addRequestProperty("Content-Disposition", "filename=\"test.html\"");
> 	conn.setRequestProperty("a", "1");
> 	conn.addRequestProperty("a", "2");
> 	System.out.println ("Single Property: "+conn.getRequestProperty("content-disposition"));
> 	System.out.println ("All Properties:");
> 	for (Map.Entry<String, List<String>> entry : conn.getRequestProperties().entrySet()) {
> 		System.out.print ("  Property: "+entry.getKey()+" = {");
> 		for (String v : entry.getValue())
> 			System.out.print (v+";");
> 		System.out.println ("}");
> 	}
> Should produce the following output:
> 	Single Property: filename="test.html"
> 	All Properties:
> 	  Property: a = {2;1;}
> 	  Property: Content-Disposition = {filename="test.html";name="file";Content-Disposition: form-data;}
> But the following output is produced:
> 	Single Property: filename="test.html"
> 	All Properties:
> 	  Property: content-disposition = {filename="test.html";}
> 	  Property: a = {2;}
> I have set the Property "a" in lower-case to make clear, that this problem is depends on the lower-case headers problem.
> 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.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.