Skip to content

Commit

Permalink
fixed #1680 , And fix the document path.
Browse files Browse the repository at this point in the history
  • Loading branch information
ltxhhz committed May 29, 2022
1 parent 4611a6b commit 303afad
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
2 changes: 1 addition & 1 deletion docs/zh_CN/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ SuperAgent是轻量级的渐进式ajax API,具有灵活性、可读性和较

## 测试文档

[**English**](/)
[**English**](/superagent/)

下面的[测试文档](../test.html)是用[Mocha](https://mochajs.org/)的"文档"报告器生成的,并直接反映了测试套件。 这提供了额外的文档来源。

Expand Down
7 changes: 5 additions & 2 deletions src/request-base.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ module.exports = RequestBase;
* @api public
*/

function RequestBase() {}
function RequestBase() { }

/**
* Clear previous timeout.
Expand Down Expand Up @@ -460,7 +460,10 @@ RequestBase.prototype.field = function (name, value, options) {
value = String(value);
}

this._getFormData().append(name, value, options);
//fix https://github.com/visionmedia/superagent/issues/1680
if (options) this._getFormData().append(name, value, options);
else this._getFormData().append(name, value);

return this;
};

Expand Down

0 comments on commit 303afad

Please sign in to comment.