insomnia icon indicating copy to clipboard operation
insomnia copied to clipboard

[Feature Request] CORS and preflight requests

Open BehindTheMath opened this issue 8 years ago • 8 comments

  • Insomnia Version: 5.12.4
  • Operating System: Windows 10 x64

Details

Currently, Insomnia ignores any possible CORS issues, and always sends the request as is.

It would be nice to have the option to enable a strict CORS mode, where Insomnia would mirror the current behavior of browsers, by following the CORS spec and performing the following steps:

  1. Check if the request requires a preflight request.
  2. If yes, send a preflight request first.
  3. If the server responds with an error, display that and abort the request.
  4. If server responds with a preflight response, check the original request against the preflight response.
  5. If it's valid, send the actual request and proceed as is done currently. (Also show the preflight request and response in the Timeline).
  6. If it's not valid, display an error explaining why, and abort the request.

This would be valuable for testing and debugging CORS issues.

BehindTheMath avatar Jan 05 '18 01:01 BehindTheMath

👋 Thanks for opening your first issue! If you're reporting a 🐞 bug, please make sure you include steps to reproduce it. If you're requesting a feature 🎁, please provide real use cases that would benefit. 👪

To help make this a smooth process, please be sure you have first read the contributing guidelines.

welcome[bot] avatar Jan 05 '18 01:01 welcome[bot]

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

stale[bot] avatar Mar 06 '18 02:03 stale[bot]

@insomnia I never received any response as to the viability of such a feature. Is this something you would consider adding to Insomnia?

BehindTheMath avatar Mar 07 '18 13:03 BehindTheMath

Sorry I missed this one @BehindTheMath!

If someone with knowledge of CORS wants to take this one on I'd be happy to help get it to a releasable state.

gschier avatar Mar 08 '18 09:03 gschier

https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS

Pettrie avatar Oct 01 '18 08:10 Pettrie

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

stale[bot] avatar May 03 '19 02:05 stale[bot]

I think this is still a viable feature, and should not be marked stale.

BehindTheMath avatar May 09 '19 03:05 BehindTheMath

I agree that this would be a viable feature. Sure wish I had it right now as we are working with some of these issues.

shutterstein avatar Oct 22 '19 16:10 shutterstein