Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save profelis/4285509 to your computer and use it in GitHub Desktop.
Save profelis/4285509 to your computer and use it in GitHub Desktop.
From 7ade5f2830bdba1d442859ddb4e0f18cab19b31f Mon Sep 17 00:00:00 2001
From: profelis <system.grand@gmail.com>
Date: Fri, 14 Dec 2012 15:15:48 +0200
Subject: [PATCH] [jeash] Allow override requestHeaders
---
jeash/net/URLLoader.hx | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/jeash/net/URLLoader.hx b/jeash/net/URLLoader.hx
index a510a88..a5a8d3c 100644
--- a/jeash/net/URLLoader.hx
+++ b/jeash/net/URLLoader.hx
@@ -62,10 +62,10 @@ class URLLoader extends EventDispatcher
public function load(request:URLRequest) {
switch (dataFormat) {
case BINARY:
- request.requestHeaders.push(new URLRequestHeader("Content-Type","application/octet-stream"));
+ request.requestHeaders.unshift(new URLRequestHeader("Content-Type","application/octet-stream"));
default:
if (request.method != "GET")
- request.requestHeaders.push(new URLRequestHeader("Content-Type","application/x-www-form-urlencoded"));
+ request.requestHeaders.unshift(new URLRequestHeader("Content-Type","application/x-www-form-urlencoded"));
}
requestUrl(
--
1.7.10.2 (Apple Git-33)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment