hc-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ol...@apache.org
Subject svn commit: r1391910 - /httpcomponents/httpcore/trunk/httpcore-ab/src/main/java/org/apache/http/benchmark/BenchmarkWorker.java
Date Sat, 29 Sep 2012 22:23:10 GMT
Author: olegk
Date: Sat Sep 29 22:23:09 2012
New Revision: 1391910

URL: http://svn.apache.org/viewvc?rev=1391910&view=rev
Log:
Fixed NPE caused by response without a Content-Type header

Modified:
    httpcomponents/httpcore/trunk/httpcore-ab/src/main/java/org/apache/http/benchmark/BenchmarkWorker.java

Modified: httpcomponents/httpcore/trunk/httpcore-ab/src/main/java/org/apache/http/benchmark/BenchmarkWorker.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpcore/trunk/httpcore-ab/src/main/java/org/apache/http/benchmark/BenchmarkWorker.java?rev=1391910&r1=1391909&r2=1391910&view=diff
==============================================================================
--- httpcomponents/httpcore/trunk/httpcore-ab/src/main/java/org/apache/http/benchmark/BenchmarkWorker.java
(original)
+++ httpcomponents/httpcore/trunk/httpcore-ab/src/main/java/org/apache/http/benchmark/BenchmarkWorker.java
Sat Sep 29 22:23:09 2012
@@ -181,7 +181,7 @@ class BenchmarkWorker implements Runnabl
 
                 HttpEntity entity = response.getEntity();
                 if (entity != null) {
-                    ContentType ct = ContentType.get(entity);
+                    ContentType ct = ContentType.getOrDefault(entity);
                     Charset charset = ct.getCharset();
                     if (charset == null) {
                         charset = HTTP.DEF_CONTENT_CHARSET;



Mime
View raw message