cordova-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Ian Clelland (JIRA)" <>
Subject [jira] [Commented] (CB-1936) Backward compatibility on FileTransfer.upload header support is broken
Date Mon, 18 Mar 2013 19:36:15 GMT


Ian Clelland commented on CB-1936:


I've tested this on Android 4.2, and as far as I can tell, {{JSON.stringify}} in the WebView
is properly encoding nulls within an array, and those nulls are sent all the way through to
the {{FileTransfer.upload()}} method. Is there a specific situation where you are seeing different
> Backward compatibility on FileTransfer.upload header support is broken
> ----------------------------------------------------------------------
>                 Key: CB-1936
>                 URL:
>             Project: Apache Cordova
>          Issue Type: Bug
>          Components: Android
>    Affects Versions: 2.2.0, 2.3.0, 2.4.0
>            Reporter: Simon MacDonald
>            Assignee: Ian Clelland
>            Priority: Minor
>             Fix For: 2.6.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
> 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:

View raw message