Skip to content

Commit

Permalink
feat: 0.9.0
Browse files Browse the repository at this point in the history
  • Loading branch information
asos-craigmorten committed Jun 16, 2020
1 parent a48d8b5 commit 6f679c8
Show file tree
Hide file tree
Showing 8 changed files with 164 additions and 137 deletions.
6 changes: 6 additions & 0 deletions .github/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# ChangeLog

## [0.9.0] - 16-06-2020

- fix: lockfile dependencies.
- fix: handling of empty bodies (Content-Length: 0) within body parsers.
- chore: update support matrix to last version of v1.0.x and include v1.1.0.

## [0.8.0] - 30-05-2020

- fix: `res.sendFile()` not correctly resolving paths, impacting `res.download()` and other APIs that use it internally.
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:

strategy:
matrix:
deno-version: [1.0.0, 1.0.2]
deno-version: [1.0.5, 1.1.0]

steps:
- uses: actions/checkout@v2
Expand Down
269 changes: 139 additions & 130 deletions lock.json

Large diffs are not rendered by default.

5 changes: 4 additions & 1 deletion src/middleware/bodyParser/json.ts
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,10 @@ export function json(options: any = {}) {
}

// skip requests without bodies
if (!hasBody(req.headers)) {
if (
!hasBody(req.headers) ||
parseInt(req.headers.get("content-length") || "") === 0
) {
req.parsedBody = {};
next();
return;
Expand Down
5 changes: 4 additions & 1 deletion src/middleware/bodyParser/raw.ts
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,10 @@ export function raw(options: any = {}) {
}

// skip requests without bodies
if (!hasBody(req.headers)) {
if (
!hasBody(req.headers) ||
parseInt(req.headers.get("content-length") || "") === 0
) {
req.parsedBody = "";
next();
return;
Expand Down
5 changes: 4 additions & 1 deletion src/middleware/bodyParser/text.ts
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,10 @@ export function text(options: any = {}) {
}

// skip requests without bodies
if (!hasBody(req.headers)) {
if (
!hasBody(req.headers) ||
parseInt(req.headers.get("content-length") || "") === 0
) {
req.parsedBody = "";
next();
return;
Expand Down
5 changes: 4 additions & 1 deletion src/middleware/bodyParser/urlencoded.ts
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,10 @@ export function urlencoded(options: any = {}) {
}

// skip requests without bodies
if (!hasBody(req.headers)) {
if (
!hasBody(req.headers) ||
parseInt(req.headers.get("content-length") || "") === 0
) {
(req as any).parsedBody = Object.fromEntries(
new URLSearchParams().entries(),
);
Expand Down
4 changes: 2 additions & 2 deletions version.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
/**
* Version of Opine.
*/
export const VERSION: string = "0.8.0";
export const VERSION: string = "0.9.0";

/**
* Supported version of Deno.
*/
export const DENO_SUPPORTED_VERSIONS: string[] = ["1.0.0", "1.0.2", "1.0.3"];
export const DENO_SUPPORTED_VERSIONS: string[] = ["1.0.5", "1.1.0"];

0 comments on commit 6f679c8

Please sign in to comment.