Skip to content

Commit

Permalink
[console] Fixes bug for docker port mapping case (#1213)
Browse files Browse the repository at this point in the history
  • Loading branch information
frankfliu authored Oct 24, 2023
1 parent 99fdab6 commit f28088f
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -299,11 +299,14 @@ private void getInferenceAddress(ChannelHandlerContext ctx, HttpMethod method) {
ConfigManager configManager = ConfigManager.getInstance();
String inferenceAddress =
configManager.getProperty("inference_address", "http://127.0.0.1:8080");
String managementAddress =
configManager.getProperty("management_address", "http://127.0.0.1:8080");
String origin = configManager.getProperty("cors_allowed_origin", "");
String methods = configManager.getProperty("cors_allowed_methods", "");
String headers = configManager.getProperty("cors_allowed_headers", "");
Map<String, String> map = new ConcurrentHashMap<>(2);
map.put("inferenceAddress", inferenceAddress);
map.put("managementAddress", managementAddress);
map.put("corsAllowed", "0");
if (!StringUtil.isNullOrEmpty(origin)
&& !StringUtil.isNullOrEmpty(headers)
Expand Down
3 changes: 2 additions & 1 deletion plugins/management-console/webapp/src/store.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,8 @@ var store = new Vuex.Store({
let res = await logAPI.inferenceAddress()
let corsAllowed = res.corsAllowed
let port = getPort(res.inferenceAddress)
if(port == window.location.port){
let mgmtPort = getPort(res.inferenceAddress)
if(port == window.location.port || port == mgmtPort){
predictionUrl = env.baseUrl
}else{
if(corsAllowed !="1"){
Expand Down

0 comments on commit f28088f

Please sign in to comment.