0

I'm developing a frontend with Angular 7 and consumes Virtualmin Remote API but my GET requests are getting denied because of CORS policy.

With Postman or cURL the GET request works fine (also the OPTIONS request) but not with Angular HTTP, it's possible to set CORS policy in the Virtualmin Remote API? How?


My headers are:

"Access-Control-Allow-Origin": "*",
"Content-Type": "application/json",
"cache-control": "no-cache",
Authorization: "Basic XXXXXXXXXXXXXXXXXXX"

I'm trying to get all the domains, https://example.com:10000/virtual-server/remote.cgi?json=1&program=list-domains

Otto
  • 4,020
  • 6
  • 35
  • 46
  • 1
    Postman and cURL are not browsers - see [this](https://stackoverflow.com/questions/36250615/cors-with-postman) for why they work – Andrew Allen May 02 '19 at 15:16

1 Answers1

0

You can avoid any issues with CORS, simply adding "https://cors-anywhere.herokuapp.com/" in the beginning of URL.