[PR #2191] [MERGED] feat: override content-type #3669

Closed
opened 2026-03-17 01:15:45 +03:00 by kerem · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/hoppscotch/hoppscotch/pull/2191
Author: @anwarulislam
Created: 3/22/2022
Status: Merged
Merged: 3/29/2022
Merged by: @liyasthomas

Base: mainHead: feat/override-contenttype


📝 Commits (10+)

  • 3dbd972 feat: content-type override feature added
  • 2175e14 main branch synced
  • f24355e Merge branch 'hoppscotch:main' into feat/override-contenttype
  • 55da36d feat: content-type override feature issue fixed
  • 4ab3b16 Merge branch 'hoppscotch:main' into feat/override-contenttype
  • 23c677b feat: reorder key-value entries (#2189)
  • 770c3f1 refactor: revamped tab system
  • 1f2fb0f refactor: enable new tab component
  • 35571ff fix: tab switching side effect
  • 4764141 fix: tab deleting side effect

📊 Changes

6 files changed (+115 additions, -35 deletions)

View changed files

📝 packages/hoppscotch-app/components/http/Body.vue (+67 -11)
📝 packages/hoppscotch-app/components/http/RequestOptions.vue (+10 -2)
📝 packages/hoppscotch-app/components/smart/EnvInput.vue (+2 -0)
📝 packages/hoppscotch-app/components/smart/Tabs.vue (+28 -20)
📝 packages/hoppscotch-app/helpers/utils/EffectiveURL.ts (+4 -1)
📝 packages/hoppscotch-app/locales/en.json (+4 -1)

📄 Description

Closes #2121

Description

Overriding Content-Type in Headers.

Checks

  • My pull request adheres to the code style of this project
  • My code requires changes to the documentation
  • I have updated the documentation as required
  • All the tests have passed

Additional Information

Previously, we were automatically assigning Content-Type from the body. No one could able to override the Content-Type from the header if they needed. They could be able to write the Content-Type but that wouldn't be prioritized. In this PR we basically fixed the issue. Checking if there's any Content-Type in headers then we're not adding Request Body's content-type with the request. Rather, the Content-Type from the header is being added in the actual request.


🔄 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/2191 **Author:** [@anwarulislam](https://github.com/anwarulislam) **Created:** 3/22/2022 **Status:** ✅ Merged **Merged:** 3/29/2022 **Merged by:** [@liyasthomas](https://github.com/liyasthomas) **Base:** `main` ← **Head:** `feat/override-contenttype` --- ### 📝 Commits (10+) - [`3dbd972`](https://github.com/hoppscotch/hoppscotch/commit/3dbd9725eb1817cf3f8b0c383513a8a5207529ee) feat: content-type override feature added - [`2175e14`](https://github.com/hoppscotch/hoppscotch/commit/2175e1404f1b00d38a6a416440ae0c244a117f9c) main branch synced - [`f24355e`](https://github.com/hoppscotch/hoppscotch/commit/f24355e6fc8ee46408bde3366cd58b136c30bce6) Merge branch 'hoppscotch:main' into feat/override-contenttype - [`55da36d`](https://github.com/hoppscotch/hoppscotch/commit/55da36d1c7725832ec5e81335bce0e2d714c153f) feat: content-type override feature issue fixed - [`4ab3b16`](https://github.com/hoppscotch/hoppscotch/commit/4ab3b16856e52d1531efe7dc87c42bda2516b556) Merge branch 'hoppscotch:main' into feat/override-contenttype - [`23c677b`](https://github.com/hoppscotch/hoppscotch/commit/23c677b1277442d52d17f2698bb51be22d9ff818) feat: reorder key-value entries (#2189) - [`770c3f1`](https://github.com/hoppscotch/hoppscotch/commit/770c3f19e31ed17a91562238f62e104d72b632aa) refactor: revamped tab system - [`1f2fb0f`](https://github.com/hoppscotch/hoppscotch/commit/1f2fb0f9c35f51c2665059d2718ece4a14677f36) refactor: enable new tab component - [`35571ff`](https://github.com/hoppscotch/hoppscotch/commit/35571ffd095ef589dce8ae164e954b11673bb8bc) fix: tab switching side effect - [`4764141`](https://github.com/hoppscotch/hoppscotch/commit/476414115f97214b481160cded56dd270fda2131) fix: tab deleting side effect ### 📊 Changes **6 files changed** (+115 additions, -35 deletions) <details> <summary>View changed files</summary> 📝 `packages/hoppscotch-app/components/http/Body.vue` (+67 -11) 📝 `packages/hoppscotch-app/components/http/RequestOptions.vue` (+10 -2) 📝 `packages/hoppscotch-app/components/smart/EnvInput.vue` (+2 -0) 📝 `packages/hoppscotch-app/components/smart/Tabs.vue` (+28 -20) 📝 `packages/hoppscotch-app/helpers/utils/EffectiveURL.ts` (+4 -1) 📝 `packages/hoppscotch-app/locales/en.json` (+4 -1) </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 #2121 <!-- Issue # here --> ### Description <!-- Add a brief description of the pull request --> Overriding `Content-Type` in Headers. <!-- You can also choose to add a list of changes and if they have been completed or not by using the markdown to-do list syntax - [ ] Not Completed - [x] Completed --> ### Checks <!-- Make sure your pull request passes the CI checks and do check the following fields as needed - --> - [x] My pull request adheres to the code style of this project - [ ] My code requires changes to the documentation - [ ] I have updated the documentation as required - [x] All the tests have passed ### Additional Information <!-- Any additional information like breaking changes, dependencies added, screenshots, comparisons between new and old behavior, etc. --> Previously, we were automatically assigning `Content-Type` from the body. No one could able to override the `Content-Type` from the header if they needed. They could be able to write the `Content-Type` but that wouldn't be prioritized. In this PR we basically fixed the issue. Checking if there's any `Content-Type` in headers then we're not adding Request Body's content-type with the request. Rather, the `Content-Type` from the header is being added in the actual request. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
kerem 2026-03-17 01:15:45 +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#3669
No description provided.