浏览代码

allow underscore in host (can be used in subdomains)

Nicolas Cannasse 11 年之前
父节点
当前提交
2e436996bb
共有 1 个文件被更改,包括 1 次插入1 次删除
  1. 1 1
      std/haxe/Http.hx

+ 1 - 1
std/haxe/Http.hx

@@ -399,7 +399,7 @@ class Http {
 
 	public function customRequest( post : Bool, api : haxe.io.Output, ?sock : AbstractSocket, ?method : String  ) {
 		this.responseData = null;
-		var url_regexp = ~/^(https?:\/\/)?([a-zA-Z\.0-9-]+)(:[0-9]+)?(.*)$/;
+		var url_regexp = ~/^(https?:\/\/)?([a-zA-Z\.0-9_-]+)(:[0-9]+)?(.*)$/;
 		if( !url_regexp.match(url) ) {
 			onError("Invalid URL");
 			return;