question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

With "follow redirect = true", 303 are followed

See original GitHub issue

Hello

Describe the bug

As you can see, the option is disabled

image

And when a got a 303 and I’m on preview mode the redirection is followed. I think this is due to the fact there is a “meta refresh” in the body, and it’s interpreted

<!DOCTYPE html>
<html>
    <head>
        <meta charset="UTF-8" />
        <meta http-equiv="refresh" content="0;url='https://api.foo.test/mobile/hotels/search/5e53460b-76df-5725-af84-27a2df117477/results?sortBy=%2Bclosest'" />

        <title>Redirecting to https://api.foo.test/mobile/hotels/search/5e53460b-76df-5725-af84-27a2df117477/results?sortBy=%2Bclosest</title>
    </head>
    <body>
        Redirecting to <a href="https://api.foo.test/mobile/hotels/search/5e53460b-76df-5725-af84-27a2df117477/results?sortBy=%2Bclosest">https://api.foo.test/mobile/hotels/search/5e53460b-76df-5725-af84-27a2df117477/results?sortBy=%2Bclosest</a>.
    </body>
</html>

More over, the redirected request does not embed the header I manually defined.

If I use “follow redirect: true” everything works fine

Desktop (please complete the following information):

  • OS: Ubuntu 18.04
  • Installation Method: APT
  • App Version 2020.4.2

image

Issue Analytics

  • State:open
  • Created 3 years ago
  • Comments:6 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
jgiovarescocommented, Nov 2, 2020

When follow redirect: true, Insomnia will follow the redirection. Insomnia is using cUrl under the hood. When the setting is checked, the option FOLLOWLOCATION is given, and cUrl will automatically redirect using the Location header when the response status is 30x.

When follow redirect: false, Insomnia will detect it can render the response in the Preview mode. This mode will display the response in a webview. It behaves like an iframe; therefore, the content is interpreted, and the meta redirect is read and trigger the redirection. The redirection is done regardless of the follow redirect settings, and the defined headers are not provided.

Honestly, I don’t know how we could handle this edge case. It would be possible to prevent navigation in the webview, but I’m not sure it is a good idea. I will let @nijikokun or @develohpanda give their thoughts.

0reactions
lyrixxcommented, May 29, 2021

Actually this issue has not been solved. If we can let it open, it will be better IMHO.

Read more comments on GitHub >

github_iconTop Results From Across the Web

303 See Other - HTTP - MDN Web Docs
The HyperText Transfer Protocol (HTTP) 303 See Other redirect status response code indicates that the redirects don't link to the requested ...
Read more >
301, 302, 303, 307, and 308: Which HTTP Redirect Status ...
HTTP status code 303 (“See Other”) tells a client that a resource is temporarily available at a different location and explicitly instructs the ......
Read more >
followRedirects property - dart:io library - Flutter - Dart API docs
Whether to follow redirects automatically. Set this property to false if this request should not automatically follow redirects. The default is true ....
Read more >
How can a java program automatically follow redirection in ...
In your case, you will need to keep following until you get a different status code as you will be redirected two times....
Read more >
HTTP 303 - Wikipedia
The HTTP response status code 303 See Other is a way to redirect web applications to a new URI, particularly after a HTTP...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found