Skip to content

Commit

Permalink
Append the port to the relative url for dev apps with direct connect
Browse files Browse the repository at this point in the history
disabled.
  • Loading branch information
nullterminated committed Feb 21, 2013
1 parent e8bbb56 commit 40df909
Showing 1 changed file with 12 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,8 @@ public class ERXWOContext extends ERXAjaxContext implements ERXMutableUserInfoHo
private static Observer observer;
private boolean _generateCompleteURLs;
private boolean _generateCompleteResourceURLs;

private static final boolean IS_DEV = ERXApplication.isDevelopmentModeSafe();

public static final String CONTEXT_KEY = "wocontext";
public static final String CONTEXT_DICTIONARY_KEY = "ERXWOContext.dict";
Expand Down Expand Up @@ -686,4 +688,14 @@ public static String ajaxActionUrl(WOContext context) {
return url;
}

@Override
protected String relativeURLWithRequestHandlerKey(String requestHandlerKey, String requestHandlerPath, String queryString) {
String result = super.relativeURLWithRequestHandlerKey(requestHandlerKey, requestHandlerPath, queryString);
if(IS_DEV && !WOApplication.application().isDirectConnectEnabled()) {
String extension = WOApplication.application().applicationExtension();
Number port = WOApplication.application().port();
result = result.replace(extension, extension + "/-" + port);
}
return result;
}
}

0 comments on commit 40df909

Please sign in to comment.