cordova-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Filip Maj (JIRA)" <j...@apache.org>
Subject [jira] [Comment Edited] (CB-1936) Backward compatibility on FileTransfer.upload header support is broken
Date Tue, 05 Feb 2013 23:59:12 GMT

    [ https://issues.apache.org/jira/browse/CB-1936?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13571954#comment-13571954
] 

Filip Maj edited comment on CB-1936 at 2/5/13 11:57 PM:
--------------------------------------------------------

Moving to 2.5.0.

[~macdonst] I suppose the following line should also be considered?

{code}
final JSONObject params = args.optJSONObject(5) == null ? new JSONObject() : args.optJSONObject(5);
{code}
                
      was (Author: filmaj):
    Moving to 2.5.0.

[~macdonst] I suppose the following line should also be considered?

{{{final JSONObject params = args.optJSONObject(5) == null ? new JSONObject() : args.optJSONObject(5);}}}
                  
> Backward compatibility on FileTransfer.upload header support is broken
> ----------------------------------------------------------------------
>
>                 Key: CB-1936
>                 URL: https://issues.apache.org/jira/browse/CB-1936
>             Project: Apache Cordova
>          Issue Type: Bug
>          Components: Android
>    Affects Versions: 2.2.0, 2.3.0, 2.4.0
>            Reporter: Simon MacDonald
>            Assignee: Simon MacDonald
>            Priority: Minor
>             Fix For: 2.5.0
>
>
> There is a bug in the Android code for backward compatibility. See if you can spot it:
> // Look for headers on the params map for backwards compatibility with older Cordova
versions.
> final JSONObject headers = args.optJSONObject(8) == null ? params.optJSONObject("headers")
: args.optJSONObject(8);
> I bet you didn't find it. The first comparison against null will fail. You see when the
arguments are stringified on the JS side the null will become a "null". So there needs to
be a comparison against the string "null" and not the null value.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

Mime
View raw message