[Geoserver-devel] [JIRA] (GEOS-8409) GZIPResponseStream should not throw Exception on flushing

Alessio Fabiani created an issue

GeoServer / BugGEOS-8409

GZIPResponseStream should not throw Exception on flushing

Issue Type:

BugBug

Assignee:

Alessio Fabiani

Components:

Main

Created:

21/Nov/17 5:51 PM

Priority:

HighHigh

Reporter:

Alessio Fabiani

Forcing GZIPResponseStream to throw an Exception when flushing if the stream is closed can cause, wrongly, unwanted exceptions.

https://github.com/geoserver/geoserver/blob/master/src/main/src/main/java/org/geoserver/filters/GZIPResponse
Stream.java#L38

The check above should instead just avoid flushing again if the stream is already closed

{{ public void flush() throws IOException {
if (!closed)

{ gzipstream.flush(); }

}}}

This happens especially on servlet filter chains. Very often it happens that a filter closes the stream. Since this is the last one called if the content-type can be compressed, it is highly probable that this will end throwing a wrong Exception.

To reproduce the error, as an instance, just try to recall the “Importer” plugin REST Endpoint from cUrl instead of a Browser.

Add Comment

Add Comment

Get Jira notifications on your phone! Download the Jira Cloud app for Android or iOS


This message was sent by Atlassian Jira (v1001.0.0-SNAPSHOT#100072-sha1:a7bb548)

Atlassian logo