Skip to content
This repository has been archived by the owner on Jul 10, 2019. It is now read-only.

Commit

Permalink
bugfix httpresponse content length skipped when empty
Browse files Browse the repository at this point in the history
  • Loading branch information
jnioche committed Feb 6, 2014
1 parent ff1d0db commit 9b0c4ff
Showing 1 changed file with 2 additions and 1 deletion.
Expand Up @@ -24,6 +24,7 @@
import java.io.InputStream;
import java.io.PushbackInputStream;

import org.apache.commons.lang.StringUtils;
import org.apache.nutch.metadata.Metadata;
import org.apache.nutch.net.protocols.Response;
import org.apache.nutch.protocol.ProtocolException;
Expand Down Expand Up @@ -81,7 +82,7 @@ private void readPlainContent(InputStream in) throws IOException {

int contentLength = Integer.MAX_VALUE; // get content length
String contentLengthString = headers.get(Response.CONTENT_LENGTH);
if (contentLengthString != null) {
if (StringUtils.isNotBlank(contentLengthString)) {
contentLengthString = contentLengthString.trim();
try {
contentLength = Integer.parseInt(contentLengthString);
Expand Down

0 comments on commit 9b0c4ff

Please sign in to comment.