Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ResponsibleAIDashboard CORS origin issue #1944

Open
Kandaraa opened this issue Feb 6, 2023 · 0 comments
Open

ResponsibleAIDashboard CORS origin issue #1944

Kandaraa opened this issue Feb 6, 2023 · 0 comments

Comments

@Kandaraa
Copy link

Kandaraa commented Feb 6, 2023

Hello

I'm facing CORS origin issue running ResponsibleAIDashboard on a server. Accessing to local host everything is fine but when I open the port and try to access through the ip public the Error analysis dashboard (of the tree) don't show up and I got these issues in the console of the browser:

1- Access to fetch at 'http://localhost:5000/importances' from origin 'http://xxx.xxx.xxx.xxx:5000' has been blocked by CORS policy: The request client is not a secure context and the resource is in more-private address space local.
2-POST http://localhost:5000/importances net::ERR_FAILED
3-Access to fetch at 'http://localhost:5000/tree' from origin 'http://xxx.xxx.xxx.xxx:5000' has been blocked by CORS policy: The request client is not a secure context and the resource is in more-private address space local.
4-POST http://localhost:5000/tree net::ERR_FAILED

I've tried to modify the local_ipython_environment.py file in rai_core_flask/environments without any result (still have the same issue) . Below is the modification:

`

def select(self, service):

    headers = ['Content-Type'] # i've added this

    service.with_credentials = False

    #service.cors = CORS(service.app) this line was comented and repalced by the line below

    service.cors = CORS(service.app, origins=['http://xxx.xxx.xxx.xxx', 'http://xxx.xxx.xxx.xxx:5000', '*'],expose_headers=headers, supports_credentials=True)

    service.env_name = LOCAL

`

please help how can I allow the CORS Origin?

Thanks in advance

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant