Skip to content
Browse files

Fix for DFL-2514, Inspection of POST data for XHR throws for some con…

…tent-types.
  • Loading branch information...
1 parent 185d8f9 commit df1261825e02d391426e91a963d45eaf9711fb44 @chriskr chriskr committed
View
1 src/build-application/build_resource_manager_1_0.js
@@ -16,6 +16,7 @@ window.app.builders.ResourceManager["1.0"] = function(service)
"text/css", "text/plain", "application/x-javascript",
"application/javascript", "text/javascript",
"application/x-www-form-urlencoded",
+ "text/xml",
""]; // <- Yes really.
// It's frelling silly, but there's a bug with core not giving us content types
// for post data, even though core generates that itself. See CORE-39597
View
4 src/network/network_templates.js
@@ -273,7 +273,9 @@ templates.network_request_body = function(req)
}
else if (type == "text")
{
- tpl = ["p", req.requestbody.content.stringData];
+ tpl = ["p", req.requestbody.content ?
+ req.requestbody.content.stringData :
+ ""];
}
else
{
View
4 src/resource-manager/resource_util.js
@@ -170,7 +170,9 @@ cls.ResourceUtil.mime_to_content_mode = function(mime)
cls.ResourceUtil.mime_to_type = function(mime, extension)
{
- return this.mime_type_map[mime];
+ return this.mime_type_map[mime.contains(";") ?
+ mime.split(';')[0].trim() :
+ mime];
}
cls.ResourceUtil.path_to_type = function(path)

0 comments on commit df12618

Please sign in to comment.
Something went wrong with that request. Please try again.