×
Namespaces

Variants
Actions
Revision as of 14:11, 16 August 2012 by skalogir (Talk | contribs)

Multiple HTTP headers of the same type cannot be handled (Known Issue)

From Nokia Developer Wiki
Jump to: navigation, search

Contents

Version Hint

Windows Phone: [[Category:Windows Phone]]
[[Category:Windows Phone 7.5]]
[[Category:Windows Phone 8]]

Nokia Asha: [[Category:Nokia Asha]]
[[Category:Nokia Asha Platform 1.0]]

Series 40: [[Category:Series 40]]
[[Category:Series 40 1st Edition]] [[Category:Series 40 2nd Edition]]
[[Category:Series 40 3rd Edition (initial release)]] [[Category:Series 40 3rd Edition FP1]] [[Category:Series 40 3rd Edition FP2]]
[[Category:Series 40 5th Edition (initial release)]] [[Category:Series 40 5th Edition FP1]]
[[Category:Series 40 6th Edition (initial release)]] [[Category:Series 40 6th Edition FP1]] [[Category:Series 40 Developer Platform 1.0]] [[Category:Series 40 Developer Platform 1.1]] [[Category:Series 40 Developer Platform 2.0]]

Symbian: [[Category:Symbian]]
[[Category:S60 1st Edition]] [[Category:S60 2nd Edition (initial release)]] [[Category:S60 2nd Edition FP1]] [[Category:S60 2nd Edition FP2]] [[Category:S60 2nd Edition FP3]]
[[Category:S60 3rd Edition (initial release)]] [[Category:S60 3rd Edition FP1]] [[Category:S60 3rd Edition FP2]]
[[Category:S60 5th Edition]]
[[Category:Symbian^3]] [[Category:Symbian Anna]] [[Category:Nokia Belle]]

Article Metadata
Tested with
Devices(s): All Series 40 platform devices (see 'Platform'); All S60 3rd Edition devices
CompatibilityArticle
Created: User:Technical writer 1 (25 Mar 2008)
Last edited: skalogir (16 Aug 2012)

Description

This issue is originally related to Java ME and has been defined in Sun's Bug Database.

The origin of the problem is that Java ME expects that HTTP headers in a given response are unique, while a web server can return multiple headers of the same type in one response. In practice, this means that only the last one of the headers will be retrieved.

How to reproduce

The problem can be reproduced by showing the headers of a HTTP connection. This can be done as follows:

 HttpConnection conn = (HttpConnection) Connector.open(HTTP_URL);
..
String httpString;
int index=0;
 
while(conn.getHeaderFieldKey(index)!=null){
 
String headerName = conn.getHeaderFieldKey(index);
httpString = headerName + ": " + conn.getHeaderField(index) + "\n";
 
//TODO: implement a Form and insert the result HTTP string to the Form
 
index++;
}

Solution

For Series 40 devices, this issue will be fixed in the firmwares of future devices.

For S60 devices, the problem has been fixed in the latest firmware versions of S60 3rd Edition, Feature Pack 1 devices.

82 page views in the last 30 days.