Base solution for your next web application
Open Closed

No Access-Control-Allow-Origin 'header is present on the re #5490


User avatar
0
annoure created

My problem is the message: 'No' Access-Control-Allow-Origin 'header is present on the requested resource. Origin 'http: // localhost: 4200' is therefore not allowed access. "

I am still on verion 5.5 of ASpnetzero. The front and back are local, here are the configs: Appsettings.js:

"App": { "ServerRootAddress": "http: // localhost: 22742", "ClientRootAddress": "http: // localhost: 4200",

"CorsOrigins": "http: //.mycompany.com,http: // localhost: 22742, http: // localhost: 4200, http: //www.certigreen.be,http: //www.certigreen.be /public/"

}

Appconfig.json

"remoteServiceBaseUrl": "http: // localhost: 22742", "appBaseUrl": "http: // localhost: 4200",

When I change the url of self.temporaryPictureUrl = "http://www.certigreen.be/public/visits/XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"; at //self.temporaryPictureUrl = AppConsts.remoteServiceBaseUrl + '/ Temp / Downloads /' + 'visits.json'; I have the erratic message mentioned above. Help me please


5 Answer(s)
  • User Avatar
    0
    maliming created
    Support Team

    <a class="postlink" href="http://www.certigreen.be/public/visits/XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX">http://www.certigreen.be/public/visits/ ... XXXXXXXXXX</a>

    This site does not support cross-domain access. You cannot change this.

  • User Avatar
    0
    annoure created

    This url gives me a json file. I hid the url on purpose. When I type the full url I have access to this file. It's my local configuration that is problematic

    [https://prnt.sc/kggzg7])

  • User Avatar
    0
    maliming created
    Support Team

    If this website (<a class="postlink" href="https://www.certigreen.be/">https://www.certigreen.be/</a>) is not yours, you cannot modify his cross-domain strategy.

    <a class="postlink" href="https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS">https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS</a>

  • User Avatar
    0
    annoure created

    Thank you for all these clarifications.

  • User Avatar
    0
    maliming created
    Support Team

    You're welcome.