Chromium Code Reviews

Unified Diff: Source/WebCore/inspector/front-end/ResourceHeadersView.js

Issue 8907036: Merge 102699 - Web Inspector: Network item view does not correctly decode "+" in request parameters. (Closed) Base URL: http://svn.webkit.org/repository/webkit/branches/chromium/963/
Patch Set: Created 9 years ago
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View side-by-side diff with in-line comments
« no previous file with comments | « LayoutTests/http/tests/inspector/network/request-parameters-decoding-expected.txt ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/WebCore/inspector/front-end/ResourceHeadersView.js
===================================================================
--- Source/WebCore/inspector/front-end/ResourceHeadersView.js (revision 102777)
+++ Source/WebCore/inspector/front-end/ResourceHeadersView.js (working copy)
@@ -127,12 +127,14 @@
/**
* @param {string} value
* @param {string} className
+ * @param {boolean} decodeParameters
*/
- _formatParameter: function(value, className)
+ _formatParameter: function(value, className, decodeParameters)
{
var errorDecoding = false;
- if (this._decodeRequestParameters) {
+ if (decodeParameters) {
+ value = value.replace(/\+/g, " ");
if (value.indexOf("%") >= 0) {
try {
value = decodeURIComponent(value);
@@ -140,7 +142,6 @@
errorDecoding = true;
}
}
- value = value.replace(/\+/g, " ");
}
var div = document.createElement("div");
div.className = className;
@@ -236,8 +237,8 @@
for (var i = 0; i < parms.length; ++i) {
var paramNameValue = document.createDocumentFragment();
- var name = this._formatParameter(parms[i].name + ":", "header-name");
- var value = this._formatParameter(parms[i].value, "header-name source-code");
+ var name = this._formatParameter(parms[i].name + ":", "header-name", this._decodeRequestParameters);
+ var value = this._formatParameter(parms[i].value, "header-value source-code", this._decodeRequestParameters);
paramNameValue.appendChild(name);
paramNameValue.appendChild(value);
« no previous file with comments | « LayoutTests/http/tests/inspector/network/request-parameters-decoding-expected.txt ('k') | no next file » | no next file with comments »

Powered by Google App Engine