insomnia icon indicating copy to clipboard operation
insomnia copied to clipboard

HTTP Status 303 See Other redirects do not use GET

Open woff94 opened this issue 3 years ago • 4 comments

Describe the bug When an API returns a 303 See Other status code, Insomnia will follow the redirect with whatever HTTP Method was used for the original request instead of using the GET method as is standard.

To Reproduce Steps to reproduce the behavior:

  1. Make a PATCH request to an endpoint that returns a 303 See Other status.
  2. See that the request calls the redirect URL with the PATCH method instead of GET.

Expected behavior The expected behavior is for the URL in the Location header to be called using the GET method.

Screenshots If applicable, add screenshots to help explain your problem.

Desktop (please complete the following information): Version: Insomnia 2021.4.0 Release date: 6/29/2021 OS: Darwin x64 19.5.0 Electron: 9.3.5 Node: 12.14.1 V8: 8.3.110.13-electron.0 Architecture: x64 node-libcurl: libcurl/7.73.0 OpenSSL/1.1.1k zlib/1.2.11 brotli/1.0.9 zstd/1.4.9 libidn2/2.1.1 libssh2/1.9.0 nghttp2/1.42.0

woff94 avatar Jul 15 '21 19:07 woff94

Is anybody looking into this issue??

Relevant Links: #439, #2187, #3753

salkeydev avatar Jul 20 '21 11:07 salkeydev

From an e-mail conversation:

Hello. When a server issues a 303 See Other, the request should be repeated, 
but the method should switch to GET. This shows up correctly in the logs:


* We are completely uploaded and fine
* Mark bundle as not supporting multiuse

< HTTP/1.1 303 See Other
[...]

* Ignoring the response-body
* Received 147 B chunk
* Connection #0 to host localhost left intact
* Issue another request to this URL: 'http://localhost:3000/...'
* Switch to GET
* Found bundle for host localhost: 0x1f79944cb60 [serially]
* Can not multiplex, even if we wanted to!
* Re-using existing connection! (#0) with host localhost
* Connected to localhost (127.0.0.1) port 3000 (#0)

However, unfortunately, Insomnia then continues with the same method, which
would be correct for a 307, but not 303.

> POST ... HTTP/1.1
> Host: localhost:3000

SleeplessByte avatar Nov 22 '21 16:11 SleeplessByte

Adding my sanitised logs from today showing the same:

> PATCH /api/profile/v1 HTTP/1.1
> Host: localhost:59223

* upload completely sent off: 21 out of 21 bytes
* Mark bundle as not supporting multiuse

< HTTP/1.1 303 See Other
< Transfer-Encoding: chunked
< Location: /api/profile/v2

* Ignoring the response-body
* Received 5 B chunk
* Connection #35 to host localhost left intact
* Issue another request to this URL: 'http://localhost:59223/api/profile/v2'
* Switch to GET
* Found bundle for host localhost: 0x213f6da97c0 [serially]
* Can not multiplex, even if we wanted to!
* Re-using existing connection! (#35) with host localhost
* Connected to localhost (::1) port 59223 (#35)

> PATCH /api/profile/v2 HTTP/1.1
> Host: localhost:59223

IFYates avatar Dec 02 '21 09:12 IFYates

Any update on this issue? Its really big problem for me because i use 303 to redirect to resource that only accepts get. Thanks for response

ZelvaMan avatar Sep 10 '22 20:09 ZelvaMan