hoppscotch / hoppscotch-extension

🧩 Browser extensions to provide more capabilities to https://hoppscotch.io
https://hoppscotch.io
MIT License
254 stars 95 forks source link

[bug]: TypeError: Failed to execute 'fetch' on 'WorkerGlobalScope': Request with GET/HEAD method cannot have body. #241

Closed udivankin closed 10 months ago

udivankin commented 10 months ago

Is there an existing issue for this?

Current behavior

GET/HEAD requests stopped working after a recent Chrome update.

Steps to reproduce

  1. Install Chrome 119 w/Browser Extension v0.28
  2. Create GET or HEAD request to any valid host (or use one that previously succeeded)
  3. No response with a suggestion to choose a proxy, just like no extension installed.
  4. Open dev console Screenshot 2023-12-19 at 23 10 58

Export to curl/fetch shows the body param (which is empty) - may be the cause.

Environment

Production

Version

Local

sats268842 commented 10 months ago

The same happened to me; it began after I updated my browser's extension to 0.28. Both the Firefox and Chrome browsers were checked. Both are affected.

sats268842 commented 10 months ago

@udivankin Is the selfhosted version being used by you?

liyasthomas commented 10 months ago

@AndrewBastin can you check this?

AndrewBastin commented 10 months ago

Yes, I can reproduce this, for the time being, a fix for it is to set the Body Content-Type to None on your requests having GET/HEAD to prevent the app from sending a body to the extension.

I will push a patch to the extension to ignore the body field on GET/HEAD methods.

sats268842 commented 10 months ago

Thank you, @AndrewBastin It's working now.

sats268842 commented 10 months ago

image This error message appears when we attempt to click the send button repeatedly. Upon restarting the browser, everything functions as intended.

AndrewBastin commented 10 months ago

@sats268842 can you open this as a new issue on this repo ?

cc: @amk-dev

AndrewBastin commented 10 months ago

I have issued a new release 0.29 which will ignore the body on GET/HEAD method calls. It should be available on both the browsers in a couple of hours.