public class MimeSniffingKit extends Object
Modifier and Type | Field and Description |
---|---|
static String |
CONTENT_DISPOSITION_ATTACHMENT |
static String |
CONTENT_DISPOSITION_INLINE |
Constructor and Description |
---|
MimeSniffingKit(ApplicationProperties applicationProperties,
com.atlassian.http.mime.HostileExtensionDetector hostileExtensionDetector) |
Modifier and Type | Method and Description |
---|---|
void |
setAttachmentResponseHeaders(CommonAttachment attachment,
String userAgent,
javax.servlet.http.HttpServletResponse httpServletResponse)
Sets the appropriate HTTP response headers on an attachment download response.
|
void |
setAttachmentResponseHeaders(String fileName,
String mimeContentType,
javax.servlet.http.HttpServletResponse httpServletResponse)
Sets the appropriate HTTP response headers on an attachment download response.
|
public static final String CONTENT_DISPOSITION_ATTACHMENT
public static final String CONTENT_DISPOSITION_INLINE
public MimeSniffingKit(ApplicationProperties applicationProperties, com.atlassian.http.mime.HostileExtensionDetector hostileExtensionDetector)
public void setAttachmentResponseHeaders(CommonAttachment attachment, String userAgent, javax.servlet.http.HttpServletResponse httpServletResponse) throws IOException
Content-Disposition
and
X-Download-Options
to force downloading rather than opening attachments.attachment
- the Attachment in playuserAgent
- the User-agent request headerhttpServletResponse
- the attachment download responseIOException
- if stuff goes wrongpublic void setAttachmentResponseHeaders(String fileName, String mimeContentType, javax.servlet.http.HttpServletResponse httpServletResponse) throws IOException
Content-Disposition
and
X-Download-Options
to force downloading rather than opening attachments.fileName
- the name of the filemimeContentType
- the content-type of the filehttpServletResponse
- the attachment download responseIOException
- if stuff goes wrongCopyright © 2002-2021 Atlassian. All Rights Reserved.