| | |
| | | } |
| | | |
| | | private String filterStr(HttpServletRequest request, HttpServletResponse response, ResEntity res, String str) { |
| | | /*String url = res.getUrl(); |
| | | if (url.contains(StaticData.AK)) { |
| | | String[] strs = url.split("\\?"); |
| | | url = strs[0]; |
| | | |
| | | if (!StringHelper.isEmpty(strs[1])) { |
| | | str = str.replace("?" + strs[1], "").replace("&" + strs[1], "").replace("&" + strs[1], ""); |
| | | } |
| | | } |
| | | if (str.contains(url)) { |
| | | String proxyUrl = res.getProxy().replace("{token}", response.getHeader("token")); |
| | | proxyUrl = request.getRequestURL().substring(0, request.getRequestURL().indexOf(proxyUrl) + proxyUrl.length()); |
| | | str = str.replace(url, proxyUrl); |
| | | |
| | | if (StaticData.THREE == res.getFirm() && str.contains(StaticData.REST_LAYER)) { |
| | | str = str.replace(url.replace("/wmts/layer/", StaticData.REST_LAYER), proxyUrl); |
| | | } |
| | | } |
| | | |
| | | return str;*/ |
| | | |
| | | String[] strs = res.getUrl().contains(StaticData.AK) ? res.getUrl().split("\\?") : new String[]{res.getUrl(), null}; |
| | | if (str.contains(strs[0])) { |
| | | String proxyUrl = res.getProxy().replace("{token}", response.getHeader("token")); |
| | |
| | | insertLog(req, ue, resId); |
| | | |
| | | String url = getSourceUrl(req, entity, token); |
| | | if (isRest) { |
| | | url = url.replace("/wmts/layer/", "/rest/layer/"); |
| | | } |
| | | res.setHeader("token", token); |
| | | forward(req, res, entity, url); |
| | | } |