forked from alibaba/nacos
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
…into the v1.x Close alibaba#8979
- Loading branch information
Showing
18 changed files
with
226 additions
and
155 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
<!-- | ||
~ Copyright 1999-2018 Alibaba Group Holding Ltd. | ||
~ | ||
~ Licensed under the Apache License, Version 2.0 (the "License"); | ||
~ you may not use this file except in compliance with the License. | ||
~ You may obtain a copy of the License at | ||
~ | ||
~ http://www.apache.org/licenses/LICENSE-2.0 | ||
~ | ||
~ Unless required by applicable law or agreed to in writing, software | ||
~ distributed under the License is distributed on an "AS IS" BASIS, | ||
~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
~ See the License for the specific language governing permissions and | ||
~ limitations under the License. | ||
--> | ||
|
||
<!DOCTYPE html> | ||
|
||
<html lang="en"> | ||
|
||
<head> | ||
<meta charset="UTF-8"> | ||
<meta name="viewport" content="width=device-width, initial-scale=1.0"> | ||
<meta http-equiv="X-UA-Compatible" content="ie=edge"> | ||
<meta http-equiv="Cache-Control" content="no-cache, no-store, must-revalidate" /> | ||
<meta http-equiv="Pragma" content="no-cache" /> | ||
<meta http-equiv="Expires" content="0" /> | ||
<title>Nacos</title> | ||
<link rel="shortcut icon" href="<%= contextPath %>img/nacos-logo.png" type="image/x-icon" /> | ||
<link rel="stylesheet" type="text/css" href="<%= contextPath %>css/bootstrap.css"> | ||
<link rel="stylesheet" type="text/css" href="<%= contextPath %>css/console1412.css"> | ||
<!-- 第三方css开始 --> | ||
<link rel="stylesheet" type="text/css" href="<%= contextPath %>css/codemirror.css"> | ||
<link rel="stylesheet" type="text/css" href="<%= contextPath %>css/merge.css"> | ||
<link rel="stylesheet" type="text/css" href="<%= contextPath %>css/icon.css"> | ||
<link rel="stylesheet" type="text/css" href="<%= contextPath %>css/font-awesome.css"> | ||
<!-- 第三方css结束 --> | ||
</head> | ||
|
||
<body> | ||
<div id="root" style="overflow:hidden"></div> | ||
<div id="app"></div> | ||
<div id="other"></div> | ||
|
||
<!-- 第三方js开始 --> | ||
<script src="<%= contextPath %>js/jquery.js"></script> | ||
<script src="<%= contextPath %>js/codemirror.js"></script> | ||
<script src="<%= contextPath %>js/javascript.js"></script> | ||
<script src="<%= contextPath %>js/xml.js"></script> | ||
<script src="<%= contextPath %>js/codemirror.addone.fullscreen.js"></script> | ||
<script src="<%= contextPath %>js/codemirror.addone.lint.js"></script> | ||
<script src="<%= contextPath %>js/codemirror.lib.json-lint.js"></script> | ||
<script src="<%= contextPath %>js/codemirror.addone.json-lint.js"></script> | ||
<script src="<%= contextPath %>js/codemirror.lib.clike-lint.js"></script> | ||
<script src="<%= contextPath %>js/diff_match_patch.js"></script> | ||
<script src="<%= contextPath %>js/merge.js"></script> | ||
<script src="<%= contextPath %>js/loader.js"></script> | ||
<!-- 第三方js结束 --> | ||
</body> | ||
|
||
</html> |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
43 changes: 43 additions & 0 deletions
43
console/src/main/java/com/alibaba/nacos/console/filter/XssFilter.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
/* | ||
* Copyright 1999-2022 Alibaba Group Holding Ltd. | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
package com.alibaba.nacos.console.filter; | ||
|
||
import org.springframework.web.filter.OncePerRequestFilter; | ||
|
||
import javax.servlet.FilterChain; | ||
import javax.servlet.ServletException; | ||
import javax.servlet.http.HttpServletRequest; | ||
import javax.servlet.http.HttpServletResponse; | ||
import java.io.IOException; | ||
|
||
/** | ||
* XSS filter. | ||
* @author onewe | ||
*/ | ||
public class XssFilter extends OncePerRequestFilter { | ||
|
||
private static final String CONTENT_SECURITY_POLICY_HEADER = "Content-Security-Policy"; | ||
|
||
private static final String CONTENT_SECURITY_POLICY = "script-src 'self'"; | ||
|
||
@Override | ||
protected void doFilterInternal(HttpServletRequest request, HttpServletResponse response, FilterChain filterChain) | ||
throws ServletException, IOException { | ||
response.setHeader(CONTENT_SECURITY_POLICY_HEADER, CONTENT_SECURITY_POLICY); | ||
filterChain.doFilter(request, response); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
Oops, something went wrong.