[GH-ISSUE #765] Empty header in headers list results in SyntaxError: Failed to execute 'setRequestHeader' #270

Closed
opened 2026-03-16 14:18:13 +03:00 by kerem · 0 comments
Owner

Originally created by @vadistic on GitHub (Apr 13, 2020).
Original GitHub issue: https://github.com/hoppscotch/hoppscotch/issues/765

Describe the bug
When the empty header is present in headers list in graphql tab any call results in syntaxt error.

// response field
SyntaxError: Failed to execute 'setRequestHeader' on 'XMLHttpRequest': '' is not a valid HTTP header field name.. Check console for details.
// console
Error DOMException: Failed to execute 'setRequestHeader' on 'XMLHttpRequest': '' is not a valid HTTP header field name.
    at https://postwoman.io/_nuxt/be6fd6eac58c44d1d090.js:2:162095
    at Object.h [as forEach] (https://postwoman.io/_nuxt/be6fd6eac58c44d1d090.js:2:73192)
    at https://postwoman.io/_nuxt/be6fd6eac58c44d1d090.js:2:162011
    at new Promise (<anonymous>)
    at t.exports (https://postwoman.io/_nuxt/be6fd6eac58c44d1d090.js:2:160865)
    at t.exports (https://postwoman.io/_nuxt/be6fd6eac58c44d1d090.js:2:184050)

To Reproduce

  1. Go to https://postwoman.io/graphql
  2. Add some valid query + header (eg. Authorization)
  3. Click "Add new" to add empty header
  4. Smash green execute button
  5. See error

Expected behavior
I would expect empty headers to be ignored.

I think it's quite common to e.g. add header an forgot about it later, or click "Add header" too many times - when testing something on the run - which I believe what postwoman is for.

In case empty header field is no-go, then I would expect this error to be handled.

I've searched for a bit, but I do not believe there's issue about it - so I thought I would let you know

Cheers!

Originally created by @vadistic on GitHub (Apr 13, 2020). Original GitHub issue: https://github.com/hoppscotch/hoppscotch/issues/765 **Describe the bug** When the empty header is present in headers list in graphql tab any call results in syntaxt error. ``` // response field SyntaxError: Failed to execute 'setRequestHeader' on 'XMLHttpRequest': '' is not a valid HTTP header field name.. Check console for details. ``` ``` // console Error DOMException: Failed to execute 'setRequestHeader' on 'XMLHttpRequest': '' is not a valid HTTP header field name. at https://postwoman.io/_nuxt/be6fd6eac58c44d1d090.js:2:162095 at Object.h [as forEach] (https://postwoman.io/_nuxt/be6fd6eac58c44d1d090.js:2:73192) at https://postwoman.io/_nuxt/be6fd6eac58c44d1d090.js:2:162011 at new Promise (<anonymous>) at t.exports (https://postwoman.io/_nuxt/be6fd6eac58c44d1d090.js:2:160865) at t.exports (https://postwoman.io/_nuxt/be6fd6eac58c44d1d090.js:2:184050) ``` **To Reproduce** 1. Go to https://postwoman.io/graphql 2. Add some valid query + header (eg. Authorization) 3. Click "Add new" to add empty header 4. Smash green execute button 5. See error **Expected behavior** I would expect empty headers to be ignored. I think it's quite common to e.g. add header an forgot about it later, or click "Add header" too many times - when testing something on the run - which I believe what postwoman is for. In case empty header field is no-go, then I would expect this error to be handled. I've searched for a bit, but I do not believe there's issue about it - so I thought I would let you know Cheers!
kerem 2026-03-16 14:18:13 +03:00
  • closed this issue
  • added the
    bug
    label
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#270
No description provided.