public interface SafeContentHeaderGuesser
Modifier and Type | Method and Description |
---|---|
Map<String,String> |
computeAttachmentHeaders(String contentType,
InputStream contents,
String name,
String userAgent,
long contentLength,
boolean hasXsrfToken,
Map<String,String[]> httpQueryParams)
Returns a map of headers with their values.
|
Map<String,String> computeAttachmentHeaders(String contentType, InputStream contents, String name, String userAgent, long contentLength, boolean hasXsrfToken, Map<String,String[]> httpQueryParams) throws IOException
The purpose of this method is to guess a safe content type header (and associated content-disposition headers), so that it is difficult to perform xss using attachments.
contentType
- the existing content-type that the attachment has.contents
- attachment contentsname
- the filename of the attachmentuserAgent
- the user agent of the client requesting the attachmentcontentLength
- the length of the attachmenthttpQueryParams
- a map of the http query parametersIOException
- if the attachments contents could not be readCopyright © 2003–2021 Atlassian. All rights reserved.