@ Override public void releaseConnection ( ) { Header header = getResponseHeader ( "content-type" ) ; if ( header != null ) { String contentTypeHeader = header . getValue ( ) ; if ( contentTypeHeader != null && contentTypeHeader . toLowerCase ( Locale . ROOT ) . contains ( "text/event-stream" ) ) { return ; } } super . releaseConnection ( ) ; }
Avoid releasing connection on event stream that is used in Server - Sent Events .