Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
S
spring-cloud-netflix
Project
Overview
Details
Activity
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
openSource
spring-cloud-netflix
Commits
f8df3378
Commit
f8df3378
authored
Mar 09, 2016
by
Jean-Eric Cuendet
Committed by
Dave Syer
Mar 09, 2016
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Verify that the stream is more than ZERO bytes before un-gzipping
Fixes gh-891
parent
3c8a0d0e
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
18 additions
and
10 deletions
+18
-10
SendResponseFilter.java
...k/cloud/netflix/zuul/filters/post/SendResponseFilter.java
+18
-10
No files found.
spring-cloud-netflix-core/src/main/java/org/springframework/cloud/netflix/zuul/filters/post/SendResponseFilter.java
View file @
f8df3378
...
@@ -125,17 +125,25 @@ public class SendResponseFilter extends ZuulFilter {
...
@@ -125,17 +125,25 @@ public class SendResponseFilter extends ZuulFilter {
// before sending to client
// before sending to client
// else, stream gzip directly to client
// else, stream gzip directly to client
if
(
context
.
getResponseGZipped
()
&&
!
isGzipRequested
)
{
if
(
context
.
getResponseGZipped
()
&&
!
isGzipRequested
)
{
try
{
// If origin tell it's GZipped but the content is ZERO bytes,
inputStream
=
new
GZIPInputStream
(
is
);
// don't try to uncompress
final
Long
len
=
context
.
getOriginContentLength
();
if
(
len
==
null
||
len
>
0
)
{
try
{
inputStream
=
new
GZIPInputStream
(
is
);
}
catch
(
java
.
util
.
zip
.
ZipException
ex
)
{
log
.
debug
(
"gzip expected but not "
+
"received assuming unencoded response "
+
RequestContext
.
getCurrentContext
()
.
getRequest
().
getRequestURL
()
.
toString
());
inputStream
=
is
;
}
}
}
catch
(
java
.
util
.
zip
.
ZipException
ex
)
{
else
{
log
.
debug
(
// Already done : inputStream = is;
"gzip expected but not "
+
"received assuming unencoded response "
+
RequestContext
.
getCurrentContext
()
.
getRequest
().
getRequestURL
()
.
toString
());
inputStream
=
is
;
}
}
}
}
else
if
(
context
.
getResponseGZipped
()
&&
isGzipRequested
)
{
else
if
(
context
.
getResponseGZipped
()
&&
isGzipRequested
)
{
...
...
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