Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Sign in / Register
Toggle navigation
S
spring-boot
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
DEMO
spring-boot
Commits
0294ad3e
Commit
0294ad3e
authored
Apr 06, 2017
by
Dr. Stefan Hüttemann
Committed by
Stephane Nicoll
Apr 10, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Allow to disable max http post size limit
Closes gh-8508
parent
492aee9c
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
22 additions
and
3 deletions
+22
-3
ServerProperties.java
...ingframework/boot/autoconfigure/web/ServerProperties.java
+2
-2
ServerPropertiesTests.java
...amework/boot/autoconfigure/web/ServerPropertiesTests.java
+20
-1
No files found.
spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/web/ServerProperties.java
View file @
0294ad3e
/*
* Copyright 2012-201
6
the original author or authors.
* Copyright 2012-201
7
the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
...
...
@@ -790,7 +790,7 @@ public class ServerProperties
if
(
maxHttpHeaderSize
>
0
)
{
customizeMaxHttpHeaderSize
(
factory
,
maxHttpHeaderSize
);
}
if
(
serverProperties
.
getMaxHttpPostSize
()
>
0
)
{
if
(
serverProperties
.
getMaxHttpPostSize
()
!=
0
)
{
customizeMaxHttpPostSize
(
factory
,
serverProperties
.
getMaxHttpPostSize
());
}
if
(
this
.
accesslog
.
enabled
)
{
...
...
spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/web/ServerPropertiesTests.java
View file @
0294ad3e
/*
* Copyright 2012-201
6
the original author or authors.
* Copyright 2012-201
7
the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
...
...
@@ -445,6 +445,25 @@ public class ServerPropertiesTests {
assertThat
(
remoteIpValve
.
getInternalProxies
()).
isEqualTo
(
"192.168.0.1"
);
}
@Test
public
void
customTomcatDisableMaxHttpPostSize
()
{
Map
<
String
,
String
>
map
=
new
HashMap
<
String
,
String
>();
map
.
put
(
"server.max-http-post-size"
,
"-1"
);
bindProperties
(
map
);
TomcatEmbeddedServletContainerFactory
container
=
new
TomcatEmbeddedServletContainerFactory
(
0
);
this
.
properties
.
customize
(
container
);
TomcatEmbeddedServletContainer
embeddedContainer
=
(
TomcatEmbeddedServletContainer
)
container
.
getEmbeddedServletContainer
();
embeddedContainer
.
start
();
try
{
assertThat
(
embeddedContainer
.
getTomcat
().
getConnector
().
getMaxPostSize
())
.
isEqualTo
(-
1
);
}
finally
{
embeddedContainer
.
stop
();
}
}
@Test
public
void
defaultUseForwardHeadersUndertow
()
throws
Exception
{
UndertowEmbeddedServletContainerFactory
container
=
spy
(
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment