Skip to content

Commit

Permalink
fix: fix release 5.1.0
Browse files Browse the repository at this point in the history
  • Loading branch information
3imed-jaberi committed Apr 7, 2024
1 parent 8018af8 commit 1e3add0
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 2 deletions.
5 changes: 4 additions & 1 deletion package.json
@@ -1,6 +1,6 @@
{
"name": "@koa/bodyparser",
"version": "5.1.0",
"version": "5.1.1",
"description": "Koa body parsing middleware",
"main": "./dist/index.js",
"module": "./dist/index.mjs",
Expand Down Expand Up @@ -69,6 +69,9 @@
"lodash.merge": "^4.6.2",
"type-is": "^1.6.18"
},
"peerDependencies": {
"koa": "^2.14.1"
},
"engines": {
"node": ">= 16"
},
Expand Down
2 changes: 2 additions & 0 deletions src/body-parser.ts
Expand Up @@ -66,6 +66,8 @@ export function bodyParserWrapper(opts: BodyParserOptions = {}) {
strict: bodyType === 'json' ? restOpts.jsonStrict : undefined,
[`${bodyType}Types`]: mimeTypes[bodyType],
limit: restOpts[`${shouldParseBodyAs('xml') ? 'xml' : bodyType}Limit`],
// eslint-disable-next-line unicorn/text-encoding-identifier-case
encoding: restOpts.encoding || 'utf-8',
};

return parser[bodyType](ctx, parserOptions) as Promise<
Expand Down
2 changes: 1 addition & 1 deletion test/middleware.test.ts
Expand Up @@ -56,7 +56,7 @@ describe("test/body-parser.test.ts", () => {
.expect({ foo: "bar" });
});

it.only("should parse json body with `content-type: application/json;charset=utf-8;` headers ok", async () => {
it("should parse json body with `content-type: application/json;charset=utf-8;` headers ok", async () => {
app.use(bodyParser());

app.use(async (ctx) => {
Expand Down

0 comments on commit 1e3add0

Please sign in to comment.