Project

General

Profile

« Previous | Next » 

Revision 10054

Added by Jing Tao over 7 years ago

Add a smart test when we set the file name for the header of "content-deposition":
When the id doesn't end with the file extention, we set the file to be id+extension.

View differences:

CNResourceHandler.java
556 556
        }
557 557
        String extension = ObjectFormatInfo.instance().getExtension(sm.getFormatId().getValue());
558 558
        String filename = id.getValue();
559
        if (extension != null) {
559
        if (extension != null && filename != null && !filename.endsWith(extension)) {
560 560
        	filename = id.getValue() + extension;
561 561
        }
562 562
        response.setContentType(mimeType);

Also available in: Unified diff