You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@royale.apache.org by gr...@apache.org on 2020/04/15 09:46:55 UTC
[royale-asjs] 03/05: Fix for URLLoader not honouring the
'contentType' setting of the URLRequest passed in. This fixes issues in
mx.rpc HttpService classes.
This is an automated email from the ASF dual-hosted git repository.
gregdove pushed a commit to branch develop
in repository https://gitbox.apache.org/repos/asf/royale-asjs.git
commit be2846e172f2bfc320b410d50ba3ae6051912a63
Author: greg-dove <gr...@gmail.com>
AuthorDate: Wed Apr 15 20:07:40 2020 +1200
Fix for URLLoader not honouring the 'contentType' setting of the URLRequest passed in. This fixes issues in mx.rpc HttpService classes.
---
.../Network/src/main/royale/org/apache/royale/net/URLLoader.as | 9 ++++-----
.../Network/src/main/royale/org/apache/royale/net/URLRequest.as | 2 +-
2 files changed, 5 insertions(+), 6 deletions(-)
diff --git a/frameworks/projects/Network/src/main/royale/org/apache/royale/net/URLLoader.as b/frameworks/projects/Network/src/main/royale/org/apache/royale/net/URLLoader.as
index 381e8a5..d4bc969 100644
--- a/frameworks/projects/Network/src/main/royale/org/apache/royale/net/URLLoader.as
+++ b/frameworks/projects/Network/src/main/royale/org/apache/royale/net/URLLoader.as
@@ -218,14 +218,13 @@ package org.apache.royale.net
element.setRequestHeader(header.name, header.value);
}
}
-
- /*
- if (request.method != HTTPConstants.GET &&
+
+ if (request.contentType && request.method != HTTPConstants.GET &&
!sawContentType && contentData) {
element.setRequestHeader(
- HTTPHeader.CONTENT_TYPE, _contentType);
+ HTTPHeader.CONTENT_TYPE, request.contentType);
}
- */
+
if (_corsCredentialsChecker != null) {
element.withCredentials = _corsCredentialsChecker(url);
}
diff --git a/frameworks/projects/Network/src/main/royale/org/apache/royale/net/URLRequest.as b/frameworks/projects/Network/src/main/royale/org/apache/royale/net/URLRequest.as
index 512d726..1b39a7e 100644
--- a/frameworks/projects/Network/src/main/royale/org/apache/royale/net/URLRequest.as
+++ b/frameworks/projects/Network/src/main/royale/org/apache/royale/net/URLRequest.as
@@ -89,7 +89,7 @@ package org.apache.royale.net
{
this.url = url;
}
- this.requestHeaders = [];
+ this._requestHeaders = [];
}
/**