зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1623004 - Modify content-length header with change in custom post data r=Honza
Differential Revision: https://phabricator.services.mozilla.com/D69574 --HG-- extra : moz-landing-system : lando
This commit is contained in:
Родитель
e6989c1f76
Коммит
fc36b9a1eb
|
@ -125,10 +125,26 @@ class CustomRequestPanel extends Component {
|
|||
: { method: val.trim() };
|
||||
break;
|
||||
case "custom-postdata-value":
|
||||
// Update "content-length" header value to reflect change
|
||||
// in post data field.
|
||||
const { requestHeaders } = request;
|
||||
const newHeaders = requestHeaders.headers.map(header => {
|
||||
if (header.name.toLowerCase() == "content-length") {
|
||||
return {
|
||||
name: header.name,
|
||||
value: val.length,
|
||||
};
|
||||
}
|
||||
return header;
|
||||
});
|
||||
|
||||
data = {
|
||||
requestPostData: {
|
||||
postData: { text: val },
|
||||
},
|
||||
requestHeaders: {
|
||||
headers: newHeaders,
|
||||
},
|
||||
};
|
||||
break;
|
||||
case "custom-query-value":
|
||||
|
|
Загрузка…
Ссылка в новой задаче