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

ASF GitHub Bot commented on CB-8761:
------------------------------------

Github user daserge commented on the pull request:

    
https://github.com/apache/cordova-plugin-file-transfer/pull/90#issuecomment-149195485
  
    @mlaponder, @lvanengelen, thanks for your contribution!
    Is there a specific reason why you did not put the new flag to the end of 
the list?
    This way it would not be needed to change other platforms interface besides 
`wp8`.
    
    Is there an opportunity to add a test case for this?
    Do I get it right that the feature is an extension of [CB-8761 WP8: 
FileTransfer does not inherit cookies from 
WebBrowser](https://issues.apache.org/jira/browse/CB-8761) for cross-origin 
case, so that the test will require a host separate from 
[cordova-labs/file-transfer](https://github.com/apache/cordova-labs/tree/cordova-filetransfer)
 -> 
[cordova-vm.apache.org](https://github.com/apache/cordova-plugin-file-transfer/blob/c79ee367a108384cbe10b8bc8038911612a67bef/tests/tests.js#L42)
 test server?
    
    I propose you to refactor this in terms of not changing unrelated platforms 
(move `useBrowserHttp` to the end) and send a proposal to 
[email protected] (and optionally to 
https://github.com/cordova/cordova-discuss/issues/) so that the community can 
discuss whether to merge it in.


> WP8: FileTransfer does not inherit cookies from WebBrowser
> ----------------------------------------------------------
>
>                 Key: CB-8761
>                 URL: https://issues.apache.org/jira/browse/CB-8761
>             Project: Apache Cordova
>          Issue Type: Improvement
>          Components: Plugin File Transfer
>            Reporter: Dan Polivy
>
> On Android and iOS (and presumably other platforms), the file transfer plugin 
> will inherit any relevant cookies from the WebBrowser control when 
> communicating with a particular domain. On WP8, however, that is not the 
> case, as HttpWebRequest does not share cookies with the WebBrowser control.
> When cookies are used for authentication, and authentication is required for 
> file uploads, it becomes important to be able to set cookies on the 
> HttpWebRequest containing the upload. This should be supported on WP8 like it 
> is on other platforms.
> I have built a solution to this problem that works; it essentially copies the 
> relevant cookies from the WebBrowser control and manually generates a Cookie 
> header for the HttpWebRequest. Due to some bugs in the version of .NET on 
> WP8, not all cookie data is accessible in this manner (e.g. path, domain), 
> however enough is there to get the job done.
> This fix is more limited to only scenarios where the browser scheme and host 
> match that of the file transfer request to avoid any security issues with 
> cookies going to the wrong domain. In my scenario, I am hosting my web pages 
> remotely, on the same server I upload files to, so this works OK. 
> Unfortunately, it won't help with scenarios where the transfer is to a 
> different remote host.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to