[GH-ISSUE #2] [CORS] No 'Access-Control-Allow-Origin' header is present on the requested resource #1

Closed
opened 2026-03-16 12:40:31 +03:00 by kerem · 8 comments
Owner

Originally created by @csells on GitHub (Aug 22, 2019).
Original GitHub issue: https://github.com/hoppscotch/hoppscotch/issues/2

Describe the bug
The following curl command works:

curl 'https://donjon.bin.sh/name/rpc.cgi?type=Party&n=10'

the equivalent command in postwoman doesn't work:

image

Desktop (please complete the following information):

  • OS: macOS
  • Browser chrome
  • Version 76
Originally created by @csells on GitHub (Aug 22, 2019). Original GitHub issue: https://github.com/hoppscotch/hoppscotch/issues/2 **Describe the bug** The following curl command works: curl 'https://donjon.bin.sh/name/rpc.cgi?type=Party&n=10' the equivalent command in postwoman doesn't work: ![image](https://user-images.githubusercontent.com/2568253/63511918-148f5b80-c4a8-11e9-9b4a-0384a3a2e106.png) **Desktop (please complete the following information):** - OS: macOS - Browser chrome - Version 76
kerem 2026-03-16 12:40:31 +03:00
Author
Owner

@csells commented on GitHub (Aug 22, 2019):

BTW, the curl command also works on plain http:// but postwoman doesn't work with a http:// URL either.

<!-- gh-comment-id:523870224 --> @csells commented on GitHub (Aug 22, 2019): BTW, the curl command also works on plain http:// but postwoman doesn't work with a http:// URL either.
Author
Owner

@AndrewBastin commented on GitHub (Aug 22, 2019):

Umm, well its a restriction due to the CORS (Cross Origin Request Policy), there isn't a client side work around to this unless the host your trying to access should respond with the appropriate CORS headers...

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

If you really want to circumvent the CORS policies and use Postwoman you can do with Browser extensions which do so, but hey, CORS policies are a security feature hence, overriding it ain't exactly safe...

As I said there isn't like a client-side (using the browser only) way to circumvent this without extensions, although I am pretty sure you could like tunnel the request through a server hosted on the same origin (or passes the CORS headers) and make it work.

Although, anyways, I will try working on a PR which routes any request failing the CORS checks through tunneling servers (something like this or this) but they come with their own restrictions (like what to do about headers for example) and stability issues.

<!-- gh-comment-id:523876485 --> @AndrewBastin commented on GitHub (Aug 22, 2019): Umm, well its a restriction due to the CORS (Cross Origin Request Policy), there isn't a client side work around to this unless the host your trying to access should respond with the appropriate CORS headers... More info on CORS : [https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS](https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS) If you really want to circumvent the CORS policies and use Postwoman you can do with Browser extensions which do so, but hey, CORS policies are a security feature hence, overriding it ain't exactly safe... As I said there isn't like a client-side (using the browser only) way to circumvent this without extensions, although I am pretty sure you could like tunnel the request through a server hosted on the same origin (or passes the CORS headers) and make it work. Although, anyways, I will try working on a PR which routes any request failing the CORS checks through tunneling servers (something like [this](https://cors-anywhere.herokuapp.com/) or [this](https://corsproxy.github.io/)) but they come with their own restrictions (like what to do about headers for example) and stability issues.
Author
Owner

@abraham commented on GitHub (Aug 22, 2019):

With #15 there is now an error displayed when CORS blocks requests.

<!-- gh-comment-id:524070115 --> @abraham commented on GitHub (Aug 22, 2019): With #15 there is now an error displayed when CORS blocks requests.
Author
Owner

@shmurf commented on GitHub (Aug 22, 2019):

There are browser plugins that you can use to get around the CORS issue but beware, CORS is there for a reason, only use the plugin when debugging or using a site like this
Here is one such plugin
https://chrome.google.com/webstore/detail/moesif-orign-cors-changer/digfbfaphojjndkpccljibejjbppifbc?hl=en-US

<!-- gh-comment-id:524091525 --> @shmurf commented on GitHub (Aug 22, 2019): There are browser plugins that you can use to get around the CORS issue but beware, CORS is there for a reason, only use the plugin when debugging or using a site like this Here is one such plugin https://chrome.google.com/webstore/detail/moesif-orign-cors-changer/digfbfaphojjndkpccljibejjbppifbc?hl=en-US
Author
Owner

@AndrewBastin commented on GitHub (Sep 30, 2019):

Assigning the issue to myself as I intend to resolve it by introducing a proxy system.

Feel free to put down any questions or any further discussion here...

<!-- gh-comment-id:536693871 --> @AndrewBastin commented on GitHub (Sep 30, 2019): Assigning the issue to myself as I intend to resolve it by introducing a proxy system. Feel free to put down any questions or any further discussion here...
Author
Owner

@liyasthomas commented on GitHub (Sep 30, 2019):

Middleware implementation has out of the box support in Nuxt.

https://nuxtjs.org/api/pages-middleware
https://nuxtjs.org/examples/middleware
https://nuxtjs.org/guide/routing#middleware

<!-- gh-comment-id:536776969 --> @liyasthomas commented on GitHub (Sep 30, 2019): Middleware implementation has out of the box support in Nuxt. https://nuxtjs.org/api/pages-middleware https://nuxtjs.org/examples/middleware https://nuxtjs.org/guide/routing#middleware
Author
Owner

@AndrewBastin commented on GitHub (Oct 11, 2019):

Umm, I am working on this, but I have some personal stuff coming up, so I will be focusing on that for a while (a week or so).

I am unassigning myself from this meanwhile, feel free to tackle this issue if you want.

<!-- gh-comment-id:541123738 --> @AndrewBastin commented on GitHub (Oct 11, 2019): Umm, I am working on this, but I have some personal stuff coming up, so I will be focusing on that for a while (a week or so). I am unassigning myself from this meanwhile, feel free to tackle this issue if you want.
Author
Owner

@philBrown commented on GitHub (Nov 7, 2019):

Given the number of questions on StackOverflow that are some form of duplicate of Why does my JavaScript code get a “No 'Access-Control-Allow-Origin' header is present on the requested resource” error when Postman does not?, I don't see this as a bad thing.

<!-- gh-comment-id:550745585 --> @philBrown commented on GitHub (Nov 7, 2019): Given the number of questions on StackOverflow that are some form of duplicate of [Why does my JavaScript code get a “No 'Access-Control-Allow-Origin' header is present on the requested resource” error when Postman does not?](https://stackoverflow.com/questions/20035101/why-does-my-javascript-code-get-a-no-access-control-allow-origin-header-is-pr), I don't see this as a bad thing.
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#1
No description provided.