fix #534 : check byte size for bom
This commit is contained in:
parent
b739e7d538
commit
43b09de15f
1 changed files with 2 additions and 2 deletions
|
@ -101,8 +101,8 @@ public class FessXpathTransformer extends XpathTransformer implements FessTransf
|
|||
try (final BufferedInputStream bis = new BufferedInputStream(responseData.getResponseBody())) {
|
||||
final byte[] bomBytes = new byte[UTF8_BOM_SIZE];
|
||||
bis.mark(UTF8_BOM_SIZE);
|
||||
bis.read(bomBytes);
|
||||
if (!isUtf8BomBytes(bomBytes)) {
|
||||
final int size = bis.read(bomBytes);
|
||||
if (size < 3 || !isUtf8BomBytes(bomBytes)) {
|
||||
bis.reset();
|
||||
}
|
||||
final InputSource is = new InputSource(bis);
|
||||
|
|
Loading…
Add table
Reference in a new issue