[PR #5141] [MERGED] fix(kernel): body size calculation in web relay #5075

Closed
opened 2026-03-17 02:33:17 +03:00 by kerem · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/hoppscotch/hoppscotch/pull/5141
Author: @soumyamakkar
Created: 6/11/2025
Status: Merged
Merged: 6/19/2025
Merged by: @jamesgeorge007

Base: patchHead: fix/response-meta-size


📝 Commits (10+)

  • c69f2f0 fix: correct body size calculation in web interceptor
  • 19ae39b fix: relay implementation
  • a0854df fix: relay implementation
  • 112fcc2 Merge pull request #1 from hoppscotch/main
  • 4ac116b Merge remote-tracking branch 'origin/fix/response-meta-size' into fix/response-meta-size
  • 51f6edf Merge branch 'patch' into fix/response-meta-size
  • 33fef03 Merge remote-tracking branch 'origin/fix/response-meta-size' into fix/response-meta-size
  • 25a098f Update index.ts
  • 0c06761 chore: clean up leftover code
  • fecb03f trying to push

📊 Changes

1 file changed (+8 additions, -5 deletions)

View changed files

📝 packages/hoppscotch-kernel/src/relay/impl/web/v/1.ts (+8 -5)

📄 Description

Closes #5133

What’s this PR about?

This PR fixes the incorrect size calculation of the response body in the kernel-interceptors. It ensures accurate measurement whether the body is an ArrayBuffer, Uint8Array, string, or object.


What's changed

  • 🐛 Fixed body size calculation logic in kernel-interceptors/browser/index.ts
  • Added check for Uint8Array.byteLength
  • 🧪 Verified accurate meta.size.body field in Relay response

Notes to reviewers

  • Please double-check the logic for response body types—especially where body instanceof ArrayBuffer vs Uint8Array might be ambiguous in some environments.
  • I have verified that other interceptor platforms (like native/extension) do not require similar adjustments.

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/hoppscotch/hoppscotch/pull/5141 **Author:** [@soumyamakkar](https://github.com/soumyamakkar) **Created:** 6/11/2025 **Status:** ✅ Merged **Merged:** 6/19/2025 **Merged by:** [@jamesgeorge007](https://github.com/jamesgeorge007) **Base:** `patch` ← **Head:** `fix/response-meta-size` --- ### 📝 Commits (10+) - [`c69f2f0`](https://github.com/hoppscotch/hoppscotch/commit/c69f2f05dca9a2332f182c6a6658a9f294d9c90a) fix: correct body size calculation in web interceptor - [`19ae39b`](https://github.com/hoppscotch/hoppscotch/commit/19ae39b1c4ba36f4079e4e480ed30fa7640d4f6b) fix: relay implementation - [`a0854df`](https://github.com/hoppscotch/hoppscotch/commit/a0854df0addfebd938cdc247c34b7699646c1f87) fix: relay implementation - [`112fcc2`](https://github.com/hoppscotch/hoppscotch/commit/112fcc257a68cb742e5f0953bc9194495dbc83a2) Merge pull request #1 from hoppscotch/main - [`4ac116b`](https://github.com/hoppscotch/hoppscotch/commit/4ac116bd9a3edfe2ebce2439b194df5a16d844c6) Merge remote-tracking branch 'origin/fix/response-meta-size' into fix/response-meta-size - [`51f6edf`](https://github.com/hoppscotch/hoppscotch/commit/51f6edf5eac4f02a2179e1022ff02f4c7ed571cd) Merge branch 'patch' into fix/response-meta-size - [`33fef03`](https://github.com/hoppscotch/hoppscotch/commit/33fef0317a9a916df3da5510372ae457116dbfed) Merge remote-tracking branch 'origin/fix/response-meta-size' into fix/response-meta-size - [`25a098f`](https://github.com/hoppscotch/hoppscotch/commit/25a098f7038521435847aff589401996062ff0b2) Update index.ts - [`0c06761`](https://github.com/hoppscotch/hoppscotch/commit/0c0676158083fbddf965d066d960cd96325b099e) chore: clean up leftover code - [`fecb03f`](https://github.com/hoppscotch/hoppscotch/commit/fecb03f50e922daf5adcbf79392a15e93ad8e323) trying to push ### 📊 Changes **1 file changed** (+8 additions, -5 deletions) <details> <summary>View changed files</summary> 📝 `packages/hoppscotch-kernel/src/relay/impl/web/v/1.ts` (+8 -5) </details> ### 📄 Description <!-- Thanks for creating this pull request 🤗 Please make sure that the pull request is limited to one type (docs, feature, etc.) and keep it as small as possible. You can open multiple PRs instead of opening a huge one. --> <!-- If this pull request closes an issue, please mention the issue number below --> Closes #5133 <!-- Add an introduction into what this PR tries to solve in a couple of sentences --> ### What’s this PR about? This PR fixes the incorrect size calculation of the response body in the `kernel-interceptors`. It ensures accurate measurement whether the body is an `ArrayBuffer`, `Uint8Array`, string, or object. --- ### What's changed - 🐛 Fixed body size calculation logic in `kernel-interceptors/browser/index.ts` - ✅ Added check for `Uint8Array.byteLength` - 🧪 Verified accurate `meta.size.body` field in Relay response --- ### Notes to reviewers - Please double-check the logic for response body types—especially where `body instanceof ArrayBuffer` vs `Uint8Array` might be ambiguous in some environments. - I have verified that other interceptor platforms (like native/extension) do not require similar adjustments. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
kerem 2026-03-17 02:33:17 +03:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/hoppscotch#5075
No description provided.