File tree Expand file tree Collapse file tree
java/org/apache/catalina/ha/backend Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -185,18 +185,21 @@ public int send(String mess) throws Exception {
185185 // read all the headers.
186186 String header = connectionReaders [i ].readLine ();
187187 int contentLength = 0 ;
188+ boolean contentLengthSeen = false ;
188189 while (header != null && !header .isEmpty ()) {
189190 int colon = header .indexOf (':' );
190191 if (colon >= 0 ) {
191192 String headerName = header .substring (0 , colon ).trim ();
192193 String headerValue = header .substring (colon + 1 ).trim ();
193194 if ("content-length" .equalsIgnoreCase (headerName )) {
194- if (contentLength > 0 ) {
195+ if (contentLengthSeen ) {
195196 log .error (sm .getString ("tcpSender.duplicateContentLength" ));
196197 close (i );
197198 // Clear any content length if one has been read.
198199 contentLength = 0 ;
199200 break ;
201+ } else {
202+ contentLengthSeen = true ;
200203 }
201204 try {
202205 contentLength = Integer .parseInt (headerValue );
You can’t perform that action at this time.
0 commit comments