Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
xxadev
jenkins
提交
8713646a
J
jenkins
项目概览
xxadev
/
jenkins
与 Fork 源项目一致
从无法访问的项目Fork
通知
3
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
J
jenkins
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
8713646a
编写于
2月 25, 2016
作者:
K
Kohsuke Kawaguchi
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
[JENKINS-23378] Servlet 3.1
Start declaring servlet 3.1 dependency
上级
da91c95f
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
9 addition
and
31 deletion
+9
-31
core/pom.xml
core/pom.xml
+2
-2
core/src/main/java/hudson/WebAppMain.java
core/src/main/java/hudson/WebAppMain.java
+3
-26
war/src/main/webapp/WEB-INF/web.xml
war/src/main/webapp/WEB-INF/web.xml
+4
-3
未找到文件。
core/pom.xml
浏览文件 @
8713646a
...
...
@@ -243,8 +243,8 @@ THE SOFTWARE.
</dependency>
<dependency>
<groupId>
javax.servlet
</groupId>
<artifactId>
servlet-api
</artifactId>
<version>
2.4
</version>
<artifactId>
javax.
servlet-api
</artifactId>
<version>
3.1.0
</version>
<scope>
provided
</scope>
</dependency>
<dependency>
...
...
core/src/main/java/hudson/WebAppMain.java
浏览文件 @
8713646a
...
...
@@ -117,7 +117,9 @@ public class WebAppMain implements ServletContextListener {
installLogger
();
markCookieAsHttpOnly
(
context
);
// Set the session cookie as HTTP only.
// See https://www.owasp.org/index.php/HttpOnly for the discussion of this topic in OWASP
context
.
getSessionCookieConfig
().
setHttpOnly
(
true
);
final
FileAndDescription
describedHomeDir
=
getHomeDir
(
event
);
home
=
describedHomeDir
.
file
.
getAbsoluteFile
();
...
...
@@ -254,31 +256,6 @@ public class WebAppMain implements ServletContextListener {
}
}
/**
* Set the session cookie as HTTP only.
*
* @see <a href="https://www.owasp.org/index.php/HttpOnly">discussion of this topic in OWASP</a>
*/
private
void
markCookieAsHttpOnly
(
ServletContext
context
)
{
try
{
Method
m
;
try
{
m
=
context
.
getClass
().
getMethod
(
"getSessionCookieConfig"
);
}
catch
(
NoSuchMethodException
x
)
{
// 3.0+
LOGGER
.
log
(
Level
.
FINE
,
"Failed to set secure cookie flag"
,
x
);
return
;
}
Object
sessionCookieConfig
=
m
.
invoke
(
context
);
// not exposing session cookie to JavaScript to mitigate damage caused by XSS
Class
scc
=
Class
.
forName
(
"javax.servlet.SessionCookieConfig"
);
Method
setHttpOnly
=
scc
.
getMethod
(
"setHttpOnly"
,
boolean
.
class
);
setHttpOnly
.
invoke
(
sessionCookieConfig
,
true
);
}
catch
(
Exception
e
)
{
LOGGER
.
log
(
Level
.
WARNING
,
"Failed to set HTTP-only cookie flag"
,
e
);
}
}
public
void
joinInit
()
throws
InterruptedException
{
initThread
.
join
();
}
...
...
war/src/main/webapp/WEB-INF/web.xml
浏览文件 @
8713646a
...
...
@@ -23,10 +23,11 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
-->
<web-app
xmlns=
"http://
java.sun.com/xml/ns/j2
ee"
<web-app
xmlns=
"http://
xmlns.jcp.org/xml/ns/java
ee"
xmlns:xsi=
"http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation=
"http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd"
version=
"2.4"
>
xsi:schemaLocation=
"http://xmlns.jcp.org/xml/ns/javaee http://xmlns.jcp.org/xml/ns/javaee/web-app_3_1.xsd"
version=
"3.1"
metadata-complete=
"true"
>
<display-name>
Jenkins v${project.version}
</display-name>
<description>
Build management system
</description>
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录