You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@flex.apache.org by pi...@apache.org on 2017/04/09 17:26:24 UTC

[3/7] git commit: [flex-asjs] [refs/heads/feature/chart-work] - CORS security. Allow auth credentials to be passed when using cross site calls. This is required as well as setting the Access-Control-Allow-Origin header on the server.

CORS security. Allow auth credentials to be passed when using cross site calls. This is required as well as setting the Access-Control-Allow-Origin header on the server.


Project: http://git-wip-us.apache.org/repos/asf/flex-asjs/repo
Commit: http://git-wip-us.apache.org/repos/asf/flex-asjs/commit/326d6979
Tree: http://git-wip-us.apache.org/repos/asf/flex-asjs/tree/326d6979
Diff: http://git-wip-us.apache.org/repos/asf/flex-asjs/diff/326d6979

Branch: refs/heads/feature/chart-work
Commit: 326d69791b37cc2aaac546bcfcd3a51e88716f2f
Parents: 11ef21a
Author: Justin Mclean <jm...@apache.org>
Authored: Sun Apr 9 13:26:30 2017 +1000
Committer: Justin Mclean <jm...@apache.org>
Committed: Sun Apr 9 13:26:30 2017 +1000

----------------------------------------------------------------------
 .../src/main/flex/org/apache/flex/net/HTTPService.as   | 13 +++++++++++++
 1 file changed, 13 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/326d6979/frameworks/projects/Network/src/main/flex/org/apache/flex/net/HTTPService.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/Network/src/main/flex/org/apache/flex/net/HTTPService.as b/frameworks/projects/Network/src/main/flex/org/apache/flex/net/HTTPService.as
index b939751..3a9968c 100644
--- a/frameworks/projects/Network/src/main/flex/org/apache/flex/net/HTTPService.as
+++ b/frameworks/projects/Network/src/main/flex/org/apache/flex/net/HTTPService.as
@@ -505,6 +505,18 @@ package org.apache.flex.net
 			return null;
 		}
 
+        /**
+         *  Allows Javascript cross-site Access-Control requests to be made
+         *  using credentials such as cookies or authorization headers
+         *
+         *  @productversion FlexJS 0.8
+         */
+        COMPILE::JS
+        public function set withCredentials(value:Boolean):void {
+            var element:XMLHttpRequest = this.element as XMLHttpRequest;
+            element.withCredentials = value;
+        }
+
         COMPILE::SWF
         private var urlLoader:flash.net.URLLoader;
         
@@ -606,6 +618,7 @@ package org.apache.flex.net
                     }
                 }
                 
+
                 if (_method !== HTTPConstants.GET &&
                     !sawContentType && contentData) {
                     element.setRequestHeader(