You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tika.apache.org by ta...@apache.org on 2018/08/03 16:18:39 UTC
[tika] branch branch_1x updated: TIKA-2673 -- fix forbidden-apis
failure and retro-fit for branch_1x
This is an automated email from the ASF dual-hosted git repository.
tallison pushed a commit to branch branch_1x
in repository https://gitbox.apache.org/repos/asf/tika.git
The following commit(s) were added to refs/heads/branch_1x by this push:
new 4475b72 TIKA-2673 -- fix forbidden-apis failure and retro-fit for branch_1x
4475b72 is described below
commit 4475b726db9e81d2daaddc2d74908141540301da
Author: TALLISON <ta...@apache.org>
AuthorDate: Fri Aug 3 12:18:21 2018 -0400
TIKA-2673 -- fix forbidden-apis failure and retro-fit for branch_1x
---
tika-core/src/test/java/org/apache/tika/mime/MimeDetectionTest.java | 1 +
.../org/apache/tika/parser/html/StandardHtmlEncodingDetectorTest.java | 4 ++--
2 files changed, 3 insertions(+), 2 deletions(-)
diff --git a/tika-core/src/test/java/org/apache/tika/mime/MimeDetectionTest.java b/tika-core/src/test/java/org/apache/tika/mime/MimeDetectionTest.java
index 1f986da..6b16360 100644
--- a/tika-core/src/test/java/org/apache/tika/mime/MimeDetectionTest.java
+++ b/tika-core/src/test/java/org/apache/tika/mime/MimeDetectionTest.java
@@ -29,6 +29,7 @@ import java.net.URL;
import org.apache.tika.config.TikaConfig;
import org.apache.tika.metadata.Metadata;
+import org.apache.tika.metadata.TikaCoreProperties;
import org.junit.Before;
import org.junit.Test;
diff --git a/tika-parsers/src/test/java/org/apache/tika/parser/html/StandardHtmlEncodingDetectorTest.java b/tika-parsers/src/test/java/org/apache/tika/parser/html/StandardHtmlEncodingDetectorTest.java
index 4311887..6053404 100644
--- a/tika-parsers/src/test/java/org/apache/tika/parser/html/StandardHtmlEncodingDetectorTest.java
+++ b/tika-parsers/src/test/java/org/apache/tika/parser/html/StandardHtmlEncodingDetectorTest.java
@@ -140,7 +140,7 @@ public class StandardHtmlEncodingDetectorTest {
@Test
public void tooLong() throws IOException {
// Create a string with 1Mb of '\0' followed by a meta
- String padded = new String(new byte[1000000]) + "<meta charset='windows-1252'>";
+ String padded = new String(new byte[1000000], StandardCharsets.US_ASCII) + "<meta charset='windows-1252'>";
// Only the first bytes should be prescanned, so the algorithm should stop before the meta tag
assertCharset(padded, null);
}
@@ -176,7 +176,7 @@ public class StandardHtmlEncodingDetectorTest {
public void replacement() throws IOException {
// Several dangerous charsets should are aliases of 'replacement' in the spec
String inString = "<meta charset='iso-2022-cn'>";
- assertCharset(new ByteArrayInputStream(inString.getBytes()), new ReplacementCharset());
+ assertCharset(new ByteArrayInputStream(inString.getBytes(StandardCharsets.US_ASCII)), new ReplacementCharset());
}
@Test