Skip to content

Commit

Permalink
Merge pull request #116 from filiphric/115-typeerror-cannot-read-prop…
Browse files Browse the repository at this point in the history
…erties-of-undefined-reading-value-for-api-response-status204-no-content

115 typeerror cannot read properties of undefined reading value for api response status204 no content
  • Loading branch information
filiphric authored Mar 17, 2023
2 parents d639f3e + da99b27 commit 6e1f87f
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 5 deletions.
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,13 @@

All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.

### [2.10.4](https://github.com/filiphric/cypress-plugin-api/compare/v2.10.3...v2.10.4) (2023-03-17)


### Bug Fixes

* make size attribute optional ([7950f38](https://github.com/filiphric/cypress-plugin-api/commits/7950f38d04a1197d2b6600e5fb7a6f1be058cf9f))

### [2.10.3](https://github.com/filiphric/cypress-plugin-api/compare/v2.10.2...v2.10.3) (2023-02-03)


Expand Down
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"author": "Filip Hric (https://filiphric.com/)",
"license": "ISC",
"name": "cypress-plugin-api",
"version": "2.10.3",
"version": "2.10.4",
"keywords": [
"cypress",
"api",
Expand Down
2 changes: 1 addition & 1 deletion src/components/StatusPanel.vue
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
class="mx-2 font-mono text-cy-green"
>{{ time }}&nbsp;ms</span>
</p>
<p>
<p v-if="size">
Size:<span
data-cy="size"
class="mx-2 font-mono text-cy-green"
Expand Down
2 changes: 1 addition & 1 deletion src/modules/handleResponse.ts
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ export const handleResponse = (res: ApiResponseBody, options: ApiRequestOptions,
props[index].responseHeaders.formatted = transform(headers)

// count content size from header if available, or calculate manually
const size = contentLengthHeader ? parseInt(contentLengthHeader) : calculateSize(props[index].responseBody.body.value)
const size = contentLengthHeader ? parseInt(contentLengthHeader) : calculateSize(props[index].responseBody.body?.value)
props[index].size = convertSize(size) // convert to readable format (kB, MB...)
res.size = size

Expand Down

0 comments on commit 6e1f87f

Please sign in to comment.