You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@cordova.apache.org by aroberson <gi...@git.apache.org> on 2015/06/15 23:05:37 UTC

[GitHub] cordova-plugin-file-transfer pull request: Add Browser support for...

GitHub user aroberson opened a pull request:

    https://github.com/apache/cordova-plugin-file-transfer/pull/88

    Add Browser support for using Cookies

    Added a property for browser to set the withCredentials flag on the XMLHttpRequest for upload and download


You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/ABB-Austin/cordova-plugin-file-transfer master

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/cordova-plugin-file-transfer/pull/88.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #88
    
----
commit 051ada102e617478a1a47c1eee8d224665f45b88
Author: aroberson <ad...@ventyx.abb.com>
Date:   2015-06-15T20:54:27Z

    Added option to allow for passing cookies automatically in the browser

commit f52d324b4fe516256c16c23eaf18ea3a3bf1ca19
Author: aroberson <ad...@ventyx.abb.com>
Date:   2015-06-15T21:03:56Z

    Updated documentation for browser

----


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@cordova.apache.org
For additional commands, e-mail: dev-help@cordova.apache.org


[GitHub] cordova-plugin-file-transfer pull request: Add Browser support for...

Posted by aroberson <gi...@git.apache.org>.
Github user aroberson closed the pull request at:

    https://github.com/apache/cordova-plugin-file-transfer/pull/88


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@cordova.apache.org
For additional commands, e-mail: dev-help@cordova.apache.org


[GitHub] cordova-plugin-file-transfer pull request: Add Browser support for...

Posted by dukex <gi...@git.apache.org>.
Github user dukex commented on a diff in the pull request:

    https://github.com/apache/cordova-plugin-file-transfer/pull/88#discussion_r32469454
  
    --- Diff: www/browser/FileTransfer.js ---
    @@ -231,7 +236,9 @@ FileTransfer.prototype.download = function(source, target, successCallback, erro
     
         var that = this;
         var xhr = transfers[this._id] = new XMLHttpRequest();
    -    
    +    if (withCredentials) {
    +        xhr.withCredentials = true;
    --- End diff --
    
    Same here


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@cordova.apache.org
For additional commands, e-mail: dev-help@cordova.apache.org


[GitHub] cordova-plugin-file-transfer pull request: Add Browser support for...

Posted by purplecabbage <gi...@git.apache.org>.
Github user purplecabbage commented on the pull request:

    https://github.com/apache/cordova-plugin-file-transfer/pull/88#issuecomment-112243188
  
    Is 'withCredentials' available everywhere? I think this has potentially wider impact than just the cordova-browser platform.
    Shouldn't we check if xhr.withCredentials exists?
    Then this could become : 
    ``` 
    if('withCredentials' in xhr) {
      xhr.withCredentials = options.withCredentials || false;
    }
    ```


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@cordova.apache.org
For additional commands, e-mail: dev-help@cordova.apache.org


[GitHub] cordova-plugin-file-transfer pull request: Add Browser support for...

Posted by dukex <gi...@git.apache.org>.
Github user dukex commented on a diff in the pull request:

    https://github.com/apache/cordova-plugin-file-transfer/pull/88#discussion_r32469314
  
    --- Diff: www/browser/FileTransfer.js ---
    @@ -121,6 +122,9 @@ FileTransfer.prototype.upload = function(filePath, server, successCallback, erro
     
         var that = this;
         var xhr = transfers[this._id] = new XMLHttpRequest();
    +    if (withCredentials) {
    +        xhr.withCredentials = true;
    --- End diff --
    
    You can remove the `if`statement and write only:
    ``` js 
     xhr.withCredentials = withCredentials
    ```


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@cordova.apache.org
For additional commands, e-mail: dev-help@cordova.apache.org


[GitHub] cordova-plugin-file-transfer pull request: Add Browser support for...

Posted by aroberson <gi...@git.apache.org>.
Github user aroberson commented on the pull request:

    https://github.com/apache/cordova-plugin-file-transfer/pull/88#issuecomment-112255281
  
    Duke,
    I did not do that on purpose as I wanted to keep it as close to possible to the original functionality.  I can make the change.
    
    I would have to check the other platforms.  Most of them already handle the use of cookies properly which is why I did not apply the change elsewhere.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@cordova.apache.org
For additional commands, e-mail: dev-help@cordova.apache.org