mirror of
https://github.com/internetarchive/heritrix3.git
synced 2026-09-23 06:05:46 +00:00
Fix failing test
* InMemoryReplayCharSequence.java
ensure redecode after problem restarts at right position
This commit is contained in:
@@ -87,6 +87,7 @@ public class InMemoryReplayCharSequence implements ReplayCharSequence {
|
||||
ByteBuffer bb = ByteBuffer.wrap(buffer);
|
||||
// Move past the HTTP header if present.
|
||||
bb.position((int) responseBodyStart);
|
||||
bb.mark();
|
||||
// Set the end-of-buffer to be end-of-content.
|
||||
bb.limit((int) size);
|
||||
Charset charset;
|
||||
@@ -103,6 +104,7 @@ public class InMemoryReplayCharSequence implements ReplayCharSequence {
|
||||
.onUnmappableCharacter(CodingErrorAction.REPORT)
|
||||
.decode(bb).asReadOnlyBuffer();
|
||||
} catch (CharacterCodingException cce) {
|
||||
bb.reset();
|
||||
decodingExceptionsCount++;
|
||||
return charset.decode(bb).asReadOnlyBuffer();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user