Skip to content

Commit

Permalink
Fix for DFL-2514, Inspection of POST data for XHR throws for some con…
Browse files Browse the repository at this point in the history
…tent-types.
  • Loading branch information
Chris K committed Sep 22, 2011
1 parent 185d8f9 commit df12618
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 2 deletions.
1 change: 1 addition & 0 deletions src/build-application/build_resource_manager_1_0.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 3 additions & 1 deletion src/network/network_templates.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
{
Expand Down
4 changes: 3 additions & 1 deletion src/resource-manager/resource_util.js
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit df12618

Please sign in to comment.