mirror of
https://github.com/gitbucket/gitbucket.git
synced 2025-11-08 14:35:52 +01:00
Small fix for #615
This commit is contained in:
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user