Skip to content

Commit bce32ff

Browse files
authored
fix condition for retrieving files for job attachments. (#3595)
1 parent c67f252 commit bce32ff

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

roda-ui/roda-wui/src/main/java/org/roda/wui/api/v2/services/JobService.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -246,7 +246,7 @@ public JobUserDetails buildJobUserDetails(User user) {
246246
public StreamResponse retrieveJobAttachment(String jobId, String attachmentId) throws NotFoundException, GenericException {
247247
Path filePath = RodaCoreFactory.getJobAttachmentsDirectoryPath().resolve(jobId).resolve(attachmentId);
248248

249-
if (!RodaCoreFactory.getJobAttachmentsDirectoryPath().startsWith(filePath)) {
249+
if (!filePath.startsWith(RodaCoreFactory.getJobAttachmentsDirectoryPath())) {
250250
throw new GenericException("Attempt to retrieve files outside the permitted scope");
251251
}
252252

0 commit comments

Comments
 (0)