Use <@spring.url/> for all relative paths in FTL
Fixes gh-125
This commit is contained in:
@@ -80,18 +80,9 @@ public class EurekaController {
|
||||
}
|
||||
|
||||
protected void populateBase(HttpServletRequest request, Map<String, Object> model) {
|
||||
String contextPath = serverProperties.getContextPath();
|
||||
String path = (contextPath == null) ? "" : contextPath + serverProperties.getServletPath();
|
||||
path = path.replace("//", "/");
|
||||
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path;
|
||||
|
||||
if (!basePath.endsWith("/")) {
|
||||
basePath += "/";
|
||||
}
|
||||
|
||||
model.put("time", new Date());
|
||||
model.put("basePath", basePath);
|
||||
model.put("dashboardPath", dashboardPath);
|
||||
model.put("time", new Date());
|
||||
model.put("basePath", "/");
|
||||
model.put("dashboardPath", dashboardPath.equals("/") ? "" : dashboardPath);
|
||||
|
||||
populateHeader(model);
|
||||
|
||||
|
||||
@@ -1,10 +1,11 @@
|
||||
<#import "/spring.ftl" as spring />
|
||||
<!doctype html>
|
||||
<!--[if lt IE 7]> <html class="no-js lt-ie9 lt-ie8 lt-ie7"> <![endif]-->
|
||||
<!--[if IE 7]> <html class="no-js lt-ie9 lt-ie8"> <![endif]-->
|
||||
<!--[if IE 8]> <html class="no-js lt-ie9"> <![endif]-->
|
||||
<!--[if gt IE 8]><!--> <html class="no-js"> <!--<![endif]-->
|
||||
<head>
|
||||
<base href="${basePath}">
|
||||
<base href="<@spring.url basePath/>">
|
||||
<title>Eureka - Last N events</title>
|
||||
<link rel="stylesheet" type="text/css" href="eureka/css/wro.css">
|
||||
</head>
|
||||
|
||||
@@ -1,10 +1,11 @@
|
||||
<#import "/spring.ftl" as spring />
|
||||
<!doctype html>
|
||||
<!--[if lt IE 7]> <html class="no-js lt-ie9 lt-ie8 lt-ie7"> <![endif]-->
|
||||
<!--[if IE 7]> <html class="no-js lt-ie9 lt-ie8"> <![endif]-->
|
||||
<!--[if IE 8]> <html class="no-js lt-ie9"> <![endif]-->
|
||||
<!--[if gt IE 8]><!--> <html class="no-js"> <!--<![endif]-->
|
||||
<head>
|
||||
<base href="${basePath}">
|
||||
<base href="<@spring.url basePath/>">
|
||||
<meta charset="utf-8">
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||
<title>Eureka</title>
|
||||
|
||||
Reference in New Issue
Block a user