浏览代码

- patch applied (issue 143)

Franco Ponticelli 15 年之前
父节点
当前提交
160f52d28c
共有 1 个文件被更改,包括 3 次插入1 次删除
  1. 3 1
      std/haxe/Http.hx

+ 3 - 1
std/haxe/Http.hx

@@ -271,7 +271,6 @@ class Http {
 	public function customRequest( post : Bool, api : haxe.io.Output, ?sock : AbstractSocket, ?method : String  ) {
 		#if php
 		var url_regexp = ~/^(https?:\/\/)?([a-zA-Z\.0-9-]+)(:[0-9]+)?(.*)$/;
-		var secure = (url_regexp.matched(1) == "https://");
 		#else
 		var url_regexp = ~/^(http:\/\/)?([a-zA-Z\.0-9-]+)(:[0-9]+)?(.*)$/;
 		#end
@@ -279,6 +278,9 @@ class Http {
 			onError("Invalid URL");
 			return;
 		}
+		#if php
+		var secure = (url_regexp.matched(1) == "https://");
+		#end
 		if ( sock == null )
 			#if php
 			sock = (secure) ? Socket.newSslSocket() : new Socket();