[GH-ISSUE #5937] [bug]: Headers with empty values are stripped/not sent in the request #2329

Open
opened 2026-03-16 23:59:22 +03:00 by kerem · 4 comments
Owner

Originally created by @jota-dantas on GitHub (Mar 4, 2026).
Original GitHub issue: https://github.com/hoppscotch/hoppscotch/issues/5937

Is there an existing issue for this?

  • I have searched existing issues and this bug hasn't been reported yet

Platform

Desktop App

Browser

Safari

Operating System

macOS

Bug Description

What happened?

When I add a header with a valid key but leave the value field completely empty, Hoppscotch appears to strip the header entirely before sending the request. The backend receives the request without that specific header key.

What I expected is

The header should be sent even if the value is empty (e.g., X-Empty-Header: ). Some APIs require the presence of the key with an empty string for specific logic or validation.

Steps to reproduce

  1. Open Hoppscotch and create a new request.
  2. Go to the Headers tab.
  3. Add a new entry: Key = My-Empty-Header, Value = (leave blank).
  4. Ensure the checkbox for the header is checked.
  5. Send the request to a mock server or inspect the outgoing network call.
  6. Observe that My-Empty-Header is missing from the request headers.

Screenshots

  • In app:
    Image

  • On my local api:
    Image

Additional context

Interceptor used: Native.

*Note: This was tested on the Desktop App.

Deployment Type

Hoppscotch Cloud

Version

v26.2.0

Originally created by @jota-dantas on GitHub (Mar 4, 2026). Original GitHub issue: https://github.com/hoppscotch/hoppscotch/issues/5937 ### Is there an existing issue for this? - [x] I have searched existing issues and this bug hasn't been reported yet ### Platform Desktop App ### Browser Safari ### Operating System macOS ### Bug Description ## What happened? When I add a header with a valid key but leave the value field completely empty, Hoppscotch appears to strip the header entirely before sending the request. The backend receives the request without that specific header key. ## What I expected is The header should be sent even if the value is empty (e.g., X-Empty-Header: ). Some APIs require the presence of the key with an empty string for specific logic or validation. ## Steps to reproduce 1. Open Hoppscotch and create a new request. 2. Go to the Headers tab. 3. Add a new entry: Key = My-Empty-Header, Value = (leave blank). 4. Ensure the checkbox for the header is checked. 5. Send the request to a mock server or inspect the outgoing network call. 6. Observe that My-Empty-Header is missing from the request headers. ## Screenshots - In app: <img width="807" height="465" alt="Image" src="https://github.com/user-attachments/assets/9c101616-70f5-4700-8480-3b0a7d0d3c13" /> - On my local api: <img width="674" height="458" alt="Image" src="https://github.com/user-attachments/assets/d3fc9e37-1eab-4fbe-9414-499de045436f" /> ## Additional context Interceptor used: Native. *Note: This was tested on the Desktop App. ### Deployment Type Hoppscotch Cloud ### Version v26.2.0
Author
Owner

@satyamkumar2692 commented on GitHub (Mar 7, 2026):

I'd like to work on this

<!-- gh-comment-id:4016400735 --> @satyamkumar2692 commented on GitHub (Mar 7, 2026): I'd like to work on this
Author
Owner

@satyamkumar2692 commented on GitHub (Mar 7, 2026):

I tested this on the latest version and tried reproducing the issue by sending a request with an empty header value using https://httpbin.org/anything. The response still shows the header with an empty value (e.g., "My-Empty-Header": ""), which suggests the header is being sent correctly.
Attaching a screenshot of the response for reference.

Image
<!-- gh-comment-id:4017017785 --> @satyamkumar2692 commented on GitHub (Mar 7, 2026): I tested this on the latest version and tried reproducing the issue by sending a request with an empty header value using https://httpbin.org/anything. The response still shows the header with an empty value (e.g., "My-Empty-Header": ""), which suggests the header is being sent correctly. Attaching a screenshot of the response for reference. <img width="1440" height="786" alt="Image" src="https://github.com/user-attachments/assets/a84fb827-1186-4ade-ba41-f3b18dca19c5" />
Author
Owner

@VishwaVikas2006 commented on GitHub (Mar 12, 2026):

Hi, I tested this locally using the latest version.

Steps:
• Created a POST request to https://httpbin.org/anything
• Added header My-Empty-Header with an empty value
• Sent the request

Result:
The response JSON includes "My-Empty-Header": "", which shows that the header is still being sent even when the value is empty.

Because of this, I wasn’t able to reproduce the issue on the current version. It may already be fixed or might only occur under specific conditions (for example the desktop app).

Image
<!-- gh-comment-id:4044699009 --> @VishwaVikas2006 commented on GitHub (Mar 12, 2026): Hi, I tested this locally using the latest version. Steps: • Created a POST request to https://httpbin.org/anything • Added header `My-Empty-Header` with an empty value • Sent the request Result: The response JSON includes `"My-Empty-Header": ""`, which shows that the header is still being sent even when the value is empty. Because of this, I wasn’t able to reproduce the issue on the current version. It may already be fixed or might only occur under specific conditions (for example the desktop app). <img width="1919" height="951" alt="Image" src="https://github.com/user-attachments/assets/6d517b38-3f7e-4aa0-acce-551787846a78" />
Author
Owner

@saksham242007 commented on GitHub (Mar 12, 2026):

Hi, I’d like to take a look at this issue. I’ll try reproducing it on the latest version and check how headers with empty values are being handled. If I’m able to reproduce the problem, I’ll work on a fix and submit a PR.

<!-- gh-comment-id:4049003141 --> @saksham242007 commented on GitHub (Mar 12, 2026): Hi, I’d like to take a look at this issue. I’ll try reproducing it on the latest version and check how headers with empty values are being handled. If I’m able to reproduce the problem, I’ll work on a fix and submit a PR.
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#2329
No description provided.