inputdataop: leave content as-is if no header found (fixes #1592)
This commit is contained in:
@@ -165,6 +165,7 @@ public class InputDataOperation extends BaseOperation<InputDataParcel> {
|
|||||||
parser.setContentDecoding(true);
|
parser.setContentDecoding(true);
|
||||||
parser.setRecurse();
|
parser.setRecurse();
|
||||||
parser.setContentHandler(new AbstractContentHandler() {
|
parser.setContentHandler(new AbstractContentHandler() {
|
||||||
|
private boolean mFoundHeaderWithFields = false;
|
||||||
private Uri uncheckedSignedDataUri;
|
private Uri uncheckedSignedDataUri;
|
||||||
String mFilename;
|
String mFilename;
|
||||||
|
|
||||||
@@ -220,12 +221,20 @@ public class InputDataOperation extends BaseOperation<InputDataParcel> {
|
|||||||
mFilename = null;
|
mFilename = null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void endHeader() throws MimeException {
|
||||||
|
if ( ! mFoundHeaderWithFields) {
|
||||||
|
parser.stop();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void field(Field field) throws MimeException {
|
public void field(Field field) throws MimeException {
|
||||||
field = DefaultFieldParser.getParser().parse(field, DecodeMonitor.SILENT);
|
field = DefaultFieldParser.getParser().parse(field, DecodeMonitor.SILENT);
|
||||||
if (field instanceof ContentDispositionField) {
|
if (field instanceof ContentDispositionField) {
|
||||||
mFilename = ((ContentDispositionField) field).getFilename();
|
mFilename = ((ContentDispositionField) field).getFilename();
|
||||||
}
|
}
|
||||||
|
mFoundHeaderWithFields = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
private void bodySignature(BodyDescriptor bd, InputStream is) throws MimeException, IOException {
|
private void bodySignature(BodyDescriptor bd, InputStream is) throws MimeException, IOException {
|
||||||
|
|||||||
Reference in New Issue
Block a user