Skip to content

refactor(server): exportssizesmiddleware returns value on peek without setting ctx.body#970

Open
LucciHank wants to merge 1 commit into
pastelsky:bundlephobiafrom
LucciHank:contribai/improve/quality/exportssizesmiddleware-returns-value-on-
Open

refactor(server): exportssizesmiddleware returns value on peek without setting ctx.body#970
LucciHank wants to merge 1 commit into
pastelsky:bundlephobiafrom
LucciHank:contribai/improve/quality/exportssizesmiddleware-returns-value-on-

Conversation

@LucciHank

Copy link
Copy Markdown

Description

When ?peek is present the middleware returns an object but never sets ctx.body (or calls next()). In Koa this leaves the response unset, producing an empty/incorrect response or hanging the request. The same pattern does not exist in the sibling exports.middleware.js.

Changes

  • server/middlewares/exportsSizes.middleware.js (modified)

Type of Change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Documentation update

Testing

  • Code follows the style guidelines of this project
  • Self-review of code completed
  • Changes generate no new warnings
  • Corresponding changes to documentation made (if applicable)

Severity: high

Contributed by Lê Thành Chỉnh
Code is a tool. Mindset is the real value.

Closes #969

…g ctx.body

When ?peek is present the middleware returns an object but never sets ctx.body (or calls next()). In Koa this leaves the response unset, producing an empty/incorrect response or hanging the request. The same pattern does not exist in the sibling exports.middleware.js.

Affected files: exportsSizes.middleware.js

Signed-off-by: Hoangg Anh <131897682+LucciHank@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

fix: exportssizesmiddleware returns value on peek without setting ctx.body

1 participant