manticore 0.6.2-java → 0.6.3-java
Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 8b96d1eb1f7f1e5b6885a5f08e24ba394ac9fac0
|
4
|
+
data.tar.gz: 1ff15070f745905119d536ae7df328ce845990a6
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1f08d3632cbe683ce2456e4cde41d05545bdf5926992067f06f25af1477d9a31bac90d797a88a4f4d4a7a56477afd9f725981958ac3082e501c18199da4875b3
|
7
|
+
data.tar.gz: d2231b58a53b86bd77af5c2f27f79d9a4ece0d72cffbace8c1a830fefcd33a84f5c710f93d1e55e76637ab48d5966c79f466ee40c911418a59e4ce440576a8c7
|
@@ -39,14 +39,19 @@ public class Manticore implements Library {
|
|
39
39
|
@JRubyMethod(name = "read_entity")
|
40
40
|
public IRubyObject readEntity(ThreadContext context, IRubyObject rEntity, Block block) throws IOException {
|
41
41
|
HttpEntity entity = (HttpEntity)rEntity.toJava(HttpEntity.class);
|
42
|
+
|
42
43
|
String charset = EntityUtils.getContentCharSet(entity);
|
43
|
-
if(charset == null) {
|
44
|
-
Encoding encoding;
|
45
|
-
try {
|
44
|
+
if (charset == null) {
|
46
45
|
String mimeType = EntityUtils.getContentMimeType(entity);
|
47
|
-
if (mimeType.startsWith("application/json")) {
|
46
|
+
if ( mimeType != null && mimeType.startsWith("application/json") ) {
|
48
47
|
charset = "UTF-8";
|
48
|
+
} else {
|
49
|
+
charset = HTTP.DEFAULT_CONTENT_CHARSET;
|
49
50
|
}
|
51
|
+
}
|
52
|
+
|
53
|
+
Encoding encoding;
|
54
|
+
try {
|
50
55
|
encoding = context.getRuntime().getEncodingService().getEncodingFromString(charset);
|
51
56
|
} catch(Throwable e) {
|
52
57
|
encoding = context.getRuntime().getEncodingService().getEncodingFromString(HTTP.DEFAULT_CONTENT_CHARSET);
|
data/lib/manticore/version.rb
CHANGED
Binary file
|