Kaynağa Gözat

fixed getClientHeader and getPostData.

Nicolas Cannasse 19 yıl önce
ebeveyn
işleme
083bd5e21b
1 değiştirilmiş dosya ile 8 ekleme ve 2 silme
  1. 8 2
      std/neko/Web.hx

+ 8 - 2
std/neko/Web.hx

@@ -92,7 +92,10 @@ class Web {
 		Retrieve a client header value sent with the request.
 		Retrieve a client header value sent with the request.
 	**/
 	**/
 	public static function getClientHeader( k : String ) {
 	public static function getClientHeader( k : String ) {
-		return new String(_get_client_header(untyped k.__s));
+		var v = _get_client_header(untyped k.__s);
+		if( v == null )
+			return null;
+		return new String(v);
 	}
 	}
 
 
 	/**
 	/**
@@ -106,7 +109,10 @@ class Web {
 		Returns all the POST data (in case of file transfert for example).
 		Returns all the POST data (in case of file transfert for example).
 	**/
 	**/
 	public static function getPostData() {
 	public static function getPostData() {
-		return new String(_get_post_data());
+		var v = _get_post_data();
+		if( v == null )
+			return null;
+		return new String(v);
 	}
 	}
 
 
 	/**
 	/**