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
e3f203a8
Commit
e3f203a8
authored
Mar 30, 2015
by
Phillip Webb
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Polish
parent
441beee2
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
6 additions
and
18 deletions
+6
-18
ServerProperties.java
...ingframework/boot/autoconfigure/web/ServerProperties.java
+4
-2
ServerPropertiesTests.java
...amework/boot/autoconfigure/web/ServerPropertiesTests.java
+2
-2
ErrorPageFilterTests.java
...pringframework/boot/context/web/ErrorPageFilterTests.java
+0
-14
No files found.
spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/web/ServerProperties.java
View file @
e3f203a8
...
...
@@ -477,6 +477,7 @@ public class ServerProperties implements EmbeddedServletContainerCustomizer, Ord
}
factory
.
addConnectorCustomizers
(
new
TomcatConnectorCustomizer
()
{
@Override
public
void
customize
(
Connector
connector
)
{
ProtocolHandler
handler
=
connector
.
getProtocolHandler
();
...
...
@@ -489,14 +490,15 @@ public class ServerProperties implements EmbeddedServletContainerCustomizer, Ord
}
private
String
coerceCompression
(
String
compression
)
{
if
(
Boolean
.
toString
(
true
).
equals
(
compression
))
{
if
(
"true"
.
equalsIgnoreCase
(
compression
))
{
return
"on"
;
}
else
if
(
Boolean
.
toString
(
false
).
equals
(
compression
))
{
if
(
"false"
.
equalsIgnoreCase
(
compression
))
{
return
"off"
;
}
return
compression
;
}
});
if
(
this
.
accessLogEnabled
)
{
...
...
spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/web/ServerPropertiesTests.java
View file @
e3f203a8
...
...
@@ -205,13 +205,13 @@ public class ServerPropertiesTests {
@Test
public
void
disableTomcatCompressionWithYaml
()
throws
Exception
{
// YAML interprets "off" as false, check that it's mapped back to off
assertThat
(
"off"
,
is
(
equalTo
(
configureCompression
(
"fa
ls
e"
))));
assertThat
(
"off"
,
is
(
equalTo
(
configureCompression
(
"fa
LS
e"
))));
}
@Test
public
void
enableTomcatCompressionWithYaml
()
throws
Exception
{
// YAML interprets "on" as true, check that it's mapped back to on
assertThat
(
"on"
,
is
(
equalTo
(
configureCompression
(
"tr
ue
"
))));
assertThat
(
"on"
,
is
(
equalTo
(
configureCompression
(
"tr
UE
"
))));
}
@Test
...
...
spring-boot/src/test/java/org/springframework/boot/context/web/ErrorPageFilterTests.java
View file @
e3f203a8
...
...
@@ -325,9 +325,7 @@ public class ErrorPageFilterTests {
@Test
public
void
responseIsNotCommitedWhenRequestIsAsync
()
throws
Exception
{
this
.
request
.
setAsyncStarted
(
true
);
this
.
filter
.
doFilter
(
this
.
request
,
this
.
response
,
this
.
chain
);
assertThat
(
this
.
chain
.
getRequest
(),
equalTo
((
ServletRequest
)
this
.
request
));
assertThat
(((
HttpServletResponseWrapper
)
this
.
chain
.
getResponse
()).
getResponse
(),
equalTo
((
ServletResponse
)
this
.
response
));
...
...
@@ -347,9 +345,7 @@ public class ErrorPageFilterTests {
throw
new
RuntimeException
(
"BAD"
);
}
};
this
.
filter
.
doFilter
(
this
.
request
,
this
.
response
,
this
.
chain
);
assertThat
(
this
.
chain
.
getRequest
(),
equalTo
((
ServletRequest
)
this
.
request
));
assertThat
(((
HttpServletResponseWrapper
)
this
.
chain
.
getResponse
()).
getResponse
(),
equalTo
((
ServletResponse
)
this
.
response
));
...
...
@@ -368,9 +364,7 @@ public class ErrorPageFilterTests {
((
HttpServletResponse
)
response
).
sendError
(
400
,
"BAD"
);
}
};
this
.
filter
.
doFilter
(
this
.
request
,
this
.
response
,
this
.
chain
);
assertThat
(
this
.
chain
.
getRequest
(),
equalTo
((
ServletRequest
)
this
.
request
));
assertThat
(((
HttpServletResponseWrapper
)
this
.
chain
.
getResponse
()).
getResponse
(),
equalTo
((
ServletResponse
)
this
.
response
));
...
...
@@ -380,9 +374,7 @@ public class ErrorPageFilterTests {
@Test
public
void
responseIsNotCommitedDuringAsyncDispatch
()
throws
Exception
{
setUpAsyncDispatch
();
this
.
filter
.
doFilter
(
this
.
request
,
this
.
response
,
this
.
chain
);
assertThat
(
this
.
chain
.
getRequest
(),
equalTo
((
ServletRequest
)
this
.
request
));
assertThat
(((
HttpServletResponseWrapper
)
this
.
chain
.
getResponse
()).
getResponse
(),
equalTo
((
ServletResponse
)
this
.
response
));
...
...
@@ -402,9 +394,7 @@ public class ErrorPageFilterTests {
throw
new
RuntimeException
(
"BAD"
);
}
};
this
.
filter
.
doFilter
(
this
.
request
,
this
.
response
,
this
.
chain
);
assertThat
(
this
.
chain
.
getRequest
(),
equalTo
((
ServletRequest
)
this
.
request
));
assertThat
(((
HttpServletResponseWrapper
)
this
.
chain
.
getResponse
()).
getResponse
(),
equalTo
((
ServletResponse
)
this
.
response
));
...
...
@@ -424,9 +414,7 @@ public class ErrorPageFilterTests {
((
HttpServletResponse
)
response
).
sendError
(
400
,
"BAD"
);
}
};
this
.
filter
.
doFilter
(
this
.
request
,
this
.
response
,
this
.
chain
);
assertThat
(
this
.
chain
.
getRequest
(),
equalTo
((
ServletRequest
)
this
.
request
));
assertThat
(((
HttpServletResponseWrapper
)
this
.
chain
.
getResponse
()).
getResponse
(),
equalTo
((
ServletResponse
)
this
.
response
));
...
...
@@ -439,9 +427,7 @@ public class ErrorPageFilterTests {
HttpServletResponse
committedResponse
=
mock
(
HttpServletResponse
.
class
);
given
(
committedResponse
.
isCommitted
()).
willReturn
(
true
);
given
(
committedResponse
.
getStatus
()).
willReturn
(
200
);
this
.
filter
.
doFilter
(
this
.
request
,
committedResponse
,
this
.
chain
);
verify
(
committedResponse
,
times
(
0
)).
flushBuffer
();
}
...
...
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