forked from Qortal/qortal
Added more validation of files received in GET /data/file/frompeer
This commit is contained in:
parent
787ef957d2
commit
1613375cc0
@ -262,6 +262,10 @@ public class DataResource {
|
||||
}
|
||||
|
||||
DataFileMessage dataFileMessage = (DataFileMessage) message;
|
||||
dataFile = dataFileMessage.getDataFile();
|
||||
if (dataFile == null || !dataFile.exists()) {
|
||||
throw ApiExceptionFactory.INSTANCE.createException(request, ApiError.FILE_NOT_FOUND);
|
||||
}
|
||||
|
||||
return Response.ok(String.format("Received file %s, size %d bytes", dataFileMessage.getDataFile(), dataFileMessage.getDataFile().size())).build();
|
||||
} catch (ApiException e) {
|
||||
|
Loading…
Reference in New Issue
Block a user