Closed rakatyal closed 8 years ago
@riknoll, @jasongin: Please review.
Is this the only workaround? If so, this quirk should definitely be documented.
I believe so. As mentioned, it fails on passing empty string as a value for SetText function. It also fails when we skip specifying a value for it. One way to avoid this is leaving out this chunk, but then we lose sending the key for the option parameter. I can document it as a quirk.
Updated to ignoring the parameter all together.
Won't using "params[key]" as the test make it also ignore non-string values such as 0 or boolean false? Testing for undefined, null and "" explicitly would be better.
Yes it would but the options parameter is supposed to have only string key-value pairs as mentioned in the README.
I tested it on Android and apparently we do accept non string values and I don't see any reason why we should not. So your suggestion sounds fair to me.
The update to check for an empty toString() result (as discussed) looks good.
…on parameter in upload function
CreateUploadAsync fails when passed an empty string as a value for SetText function. It also fails when we skip specifying a value for it. So when a user passes an empty string, skip the parameter instead.