incubator-callback-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Andrew Grieve (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (CB-765) Header support for PhoneGap's FileTransfer (Upload)
Date Sat, 28 Jul 2012 02:17:33 GMT

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

Andrew Grieve commented on CB-765:
----------------------------------

These pull requests are now all merged.

https://git-wip-us.apache.org/repos/asf?p=incubator-cordova-js.git;a=commit;h=8c46a970a0719d0f16a225b75421ecf6f12dcc02
https://git-wip-us.apache.org/repos/asf?p=incubator-cordova-android.git;a=commit;h=3d53b9244d84cac9bdee445b7c07ffeb41a550bf
https://git-wip-us.apache.org/repos/asf?p=incubator-cordova-ios.git;a=commit;h=fa8cbdaba44b9131a5181368efbd451e0761c686
https://git-wip-us.apache.org/repos/asf?p=incubator-cordova-mobile-spec.git;a=commit;h=acbd72fd3d338810ee2b7fab64035c8d9463d1f3
https://git-wip-us.apache.org/repos/asf?p=incubator-cordova-mobile-spec.git;a=commit;h=c101ed2a7d966c530e899d7d1e150e9f668f9fe7
https://git-wip-us.apache.org/repos/asf?p=incubator-cordova-mobile-spec.git;a=commit;h=e19bc127d75324ab6bfadc689d2e78b99eab2551
https://git-wip-us.apache.org/repos/asf?p=incubator-cordova-docs.git;a=commit;h=3a9117a84906ab772140c3b3559026b4d2cb4efa


                
> Header support for PhoneGap's FileTransfer (Upload)
> ---------------------------------------------------
>
>                 Key: CB-765
>                 URL: https://issues.apache.org/jira/browse/CB-765
>             Project: Apache Cordova
>          Issue Type: Improvement
>          Components: iOS
>    Affects Versions: 1.7.0
>            Reporter: Aurelien MERCIER
>            Assignee: Herm Wong
>             Fix For: 1.9.0
>
>   Original Estimate: 1h
>  Remaining Estimate: 1h
>
> It would be great to support headers for FileTransfer's iOS version (as done in Android:
CB-78).
> Right now, I had redefined CDVFileTranfer for our needs and added just after userAgent
definition:
> if(userAgent) {
> 		[req setValue: userAgent forHTTPHeaderField:@"User-Agent"];
> 	} 
>     
>     NSMutableDictionary* headers = [params objectForKey:@"headers"];
>     NSEnumerator *enumerator = [headers keyEnumerator];
> 	id key;
> 	id val;
>     NSString *nkey;
> 	
> 	while (nkey = [enumerator nextObject]) {
> 		val = [headers objectForKey:nkey];
> 		if(!val || val == [NSNull null]) {
> 			continue;	
> 		}
> 		// if it responds to stringValue selector (eg NSNumber) get the NSString
> 		if ([val respondsToSelector:@selector(stringValue)]) {
> 			val = [val stringValue];
> 		}
> 		// finally, check whether it is a NSString (for dataUsingEncoding selector below)
> 		if (![val isKindOfClass:[NSString class]]) {
> 			continue;
> 		}
>         
>         //if ([key respondsToSelector:@selector(stringValue)]) {
>         [req setValue:val forHTTPHeaderField:nkey];
>         //}	
>     }
> If you can include this code or similar one into future version of Cordova it will be
awesome.
> Thanks,

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

Mime
View raw message