platform/shared/rubyJVM/src/com/rho/net/NetRequest.java in rhodes-2.0.0.beta7 vs platform/shared/rubyJVM/src/com/rho/net/NetRequest.java in rhodes-2.0.0.beta8

- old
+ new

@@ -11,10 +11,11 @@ import com.rho.FilePath; import com.rho.IRhoRubyHelper; import com.rho.RhoConf; import com.rho.RhoEmptyLogger; import com.rho.RhoLogger; +import com.rho.RhodesApp; import com.rho.file.*; import java.util.Enumeration; import java.util.Hashtable; import java.util.Vector; @@ -223,11 +224,11 @@ public NetResponse pushData(String strUrl, String strBody, IRhoSession oSession)throws Exception { m_bCancel = false; - if ( URI.isLocalHost(strUrl) ) + if ( RhodesApp.getInstance().isRhodesAppUrl(strUrl) ) { IRhoRubyHelper helper = RhoClassFactory.createRhoRubyHelper(); return helper.postUrl(strUrl,strBody); } @@ -592,22 +593,12 @@ } return false; } - public String resolveUrl(String url) throws Exception + public String resolveUrl(String strUrl) throws Exception { - if ( url == null || url.length() == 0 ) - return ""; - - String _httpRoot = RhoClassFactory.getNetworkAccess().getHomeUrl(); - if(!_httpRoot.endsWith("/")) - _httpRoot = _httpRoot + "/"; - url.replace('\\', '/'); - if ( !url.startsWith(_httpRoot) ) - url = FilePath.join(_httpRoot, url); - - return url; + return RhodesApp.getInstance().canonicalizeRhoUrl(strUrl); } public void cancel() { m_bCancel = true;