Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for CSP Reporting & ndJSON #397

Closed
wants to merge 3 commits into from
Closed
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions core/api.cfc
Original file line number Diff line number Diff line change
Expand Up @@ -695,6 +695,15 @@

<cfset requestObj.body = getRequestBody() />
<cfset requestObj.contentType = cgi.content_type />

<cfif isSimpleValue(requestObj.body) and listlen(requestObj.Body,chr(10)) GT 1 and not isJSON(requestObj.body) and isJSON("[" & javacast("string", requestObj.body).replace("\n", ",") & "]")>
<cfset requestObj.contentType = "application/json">
<cfset requestObj.body = "[" & javacast("string", requestObj.body).replace("\n", ",") & "]">
</cfif>

<cfif requestObj.contentType is "application/csp-report">
<cfset requestObj.contentType = "application/json">
</cfif>
<cfif len(requestObj.body) AND requestObj.body neq "null">
<cfif findNoCase("multipart/form-data", requestObj.contentType)>
<!--- do nothing, to support the way railo handles multipart requests (just avoids the error condition below) --->
Expand Down