Commit dee02a3f authored by Hubert Boma Manilla's avatar Hubert Boma Manilla
Browse files

Bug 1642201 - Remove undefined and trim the headers for edit & resend. r=Honza, a=jcristau

Differential Revision: https://phabricator.services.mozilla.com/D77617
parent 4a4248cf
......@@ -206,7 +206,7 @@ class CustomRequestPanel extends Component {
if (requestHeaders) {
headers = requestHeaders.customHeadersValue
? requestHeaders.customHeadersValue
: writeHeaderText(requestHeaders.headers);
: writeHeaderText(requestHeaders.headers).trim();
}
const queryArray = url ? parseQueryString(getUrlQuery(url)) : [];
let params = customQueryValue;
......
......@@ -133,7 +133,7 @@ function formDataURI(mimeType, encoding, text) {
*/
function writeHeaderText(headers, preHeaderText) {
let result = "";
if (preHeaderText != "") {
if (preHeaderText) {
result += preHeaderText + "\r\n";
}
result += headers.map(({ name, value }) => name + ": " + value).join("\r\n");
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment