Small fix for #615

This commit is contained in:
Naoki Takezoe
2015-02-01 12:55:37 +09:00
parent 0d81a9a9b6
commit 6a758902ef
5 changed files with 8 additions and 8 deletions

View File

@@ -134,8 +134,10 @@ abstract class ControllerBase extends ScalatraFilter
if (path.startsWith("http")) path
else baseUrl + super.url(path, params, false, false, false)
/** against XSS */
def outputUploadedRawData[DATATYPE](contentType: String, rawData: DATATYPE): DATATYPE = {
/**
* Use this method to response the raw data against XSS.
*/
protected def RawData[T](contentType: String, rawData: T): T = {
if(contentType.split(";").head.trim.toLowerCase.startsWith("text/html")){
this.contentType = "text/plain"
} else {