LoginSignup
0
0

No 'Access-Control-Allow-Origin' header is present on the requested resource.

Last updated at Posted at 2024-02-14

I checked CORS in Salesforce Setting, and I added to 'https:XXXXX.com'

Maybe CORS Errors seemed to disapear.

Access to XMLHttpRequest at 'https://sandboxname.sandbox.my.salesforce-sites.com/embeddedService/sidebarApp.app?aura.format=JSON&aura.formatAdapter=LIGHTNING_OUT&guestUserLang=en-US&eswConfigDeveloperName=Purl_Pages_Helper' from origin 'https://testenvironment2.com' has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource.

I think you need to configure settings to add response headers as shown below.
Can you add settings to the web server?

Access-Control-Allow-Origin: https://testenvironment2.com

SAP

Access to XMLHttpRequest at '
https://test.salesforce.com/servlet/servlet.WebToLead?encoding=UTF-8&orgId=0000000000000'
from origin '
https://xyz.com.au
' has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource.

どうすれば修正できますか?
ドメイン B のサーバーの所有者/コントローラーのみ。salesforce.com がこれらのサーバーを運用しており、CORS を許可するとセキュリティ/プライバシーのリスクがあると判断したため、Web-to-Lead ではこのアクセスを許可しません。使用しているドメインを変更しても問題は解決しません。

これを修正することはできないため、別の解決策は、管理するプロキシ サーバーを使用することです。これは、開発しているのと同じサイトである場合もあれば、ヘッダーを追加してAccess-Control-Allow-Originそのサービスが処理のためにリクエストを salesforce.com のサーバーに転送することによって CORS を特別に許可するプロキシである場合もあります。

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0