diff --git a/pom.xml b/pom.xml index 0eaf2f761..df314b7ce 100644 --- a/pom.xml +++ b/pom.xml @@ -1,7 +1,7 @@ us.codecraft - 0.10.2 + 0.10.3 4.0.0 pom diff --git a/webmagic-core/pom.xml b/webmagic-core/pom.xml index 8803b6ede..20a942791 100644 --- a/webmagic-core/pom.xml +++ b/webmagic-core/pom.xml @@ -3,7 +3,7 @@ us.codecraft webmagic-parent - 0.10.2 + 0.10.3 4.0.0 diff --git a/webmagic-core/src/main/java/us/codecraft/webmagic/downloader/HttpClientDownloader.java b/webmagic-core/src/main/java/us/codecraft/webmagic/downloader/HttpClientDownloader.java index d93fc03c0..39deecc73 100644 --- a/webmagic-core/src/main/java/us/codecraft/webmagic/downloader/HttpClientDownloader.java +++ b/webmagic-core/src/main/java/us/codecraft/webmagic/downloader/HttpClientDownloader.java @@ -103,8 +103,8 @@ public void setThread(int thread) { protected Page handleResponse(Request request, String charset, HttpResponse httpResponse, Task task) throws IOException { HttpEntity entity = httpResponse.getEntity(); - byte[] bytes = entity != null ? IOUtils.toByteArray(entity.getContent()) : new byte[0];; - String contentType = httpResponse.getEntity().getContentType() == null ? "" : httpResponse.getEntity().getContentType().getValue(); + byte[] bytes = entity != null ? IOUtils.toByteArray(entity.getContent()) : new byte[0]; + String contentType = entity != null && entity.getContentType() != null ? entity.getContentType().getValue() : null; Page page = new Page(); page.setBytes(bytes); if (!request.isBinaryContent()) { diff --git a/webmagic-coverage/pom.xml b/webmagic-coverage/pom.xml index 8754c4782..46b66f328 100644 --- a/webmagic-coverage/pom.xml +++ b/webmagic-coverage/pom.xml @@ -8,7 +8,7 @@ us.codecraft webmagic-parent - 0.10.2 + 0.10.3 webmagic-coverage diff --git a/webmagic-extension/pom.xml b/webmagic-extension/pom.xml index 03ef006d5..dd72ccbd9 100644 --- a/webmagic-extension/pom.xml +++ b/webmagic-extension/pom.xml @@ -3,7 +3,7 @@ us.codecraft webmagic-parent - 0.10.2 + 0.10.3 4.0.0 diff --git a/webmagic-samples/pom.xml b/webmagic-samples/pom.xml index 0f53566ac..3f191c7b7 100644 --- a/webmagic-samples/pom.xml +++ b/webmagic-samples/pom.xml @@ -3,7 +3,7 @@ webmagic-parent us.codecraft - 0.10.2 + 0.10.3 4.0.0 diff --git a/webmagic-saxon/pom.xml b/webmagic-saxon/pom.xml index 4b72dbdda..cbd1621ca 100644 --- a/webmagic-saxon/pom.xml +++ b/webmagic-saxon/pom.xml @@ -3,7 +3,7 @@ webmagic-parent us.codecraft - 0.10.2 + 0.10.3 4.0.0 diff --git a/webmagic-scripts/pom.xml b/webmagic-scripts/pom.xml index aa11e1c6f..568c8d0b8 100644 --- a/webmagic-scripts/pom.xml +++ b/webmagic-scripts/pom.xml @@ -3,7 +3,7 @@ webmagic-parent us.codecraft - 0.10.2 + 0.10.3 4.0.0 diff --git a/webmagic-selenium/pom.xml b/webmagic-selenium/pom.xml index e53dbee59..a7a9179bc 100644 --- a/webmagic-selenium/pom.xml +++ b/webmagic-selenium/pom.xml @@ -3,7 +3,7 @@ webmagic-parent us.codecraft - 0.10.2 + 0.10.3 4.0.0