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

The Same Origin Policy disallows reading the remote resource #34

Closed
0x1100010010 opened this issue Mar 11, 2020 · 2 comments
Closed

The Same Origin Policy disallows reading the remote resource #34

0x1100010010 opened this issue Mar 11, 2020 · 2 comments

Comments

@0x1100010010
Copy link

0x1100010010 commented Mar 11, 2020

Also, miner's stats are not being updated when accessed from the remote browser at http://ipaddress/miner.html. This exception is thrown in consol.

Cross-Origin Request Blocked: The Same Origin Policy disallows reading the remote resource at http://ipaddress:3330/miner/. (Reason: CORS header ‘Access-Control-Allow-Origin’ missing).

I am using caddy webserver Caddyfile.

:80 {
        root /home/grin/.go/src/open-grin-pool/web
        gzip
        cors
        header / {
                Access-Control-Allow-Origin  "*"
                Access-Control-Allow-Headers "*"
                Access-Control-Allow-Methods "*"
                -Server
        }
}

As you can see I have tried to fix the issue by escalating all permissions but without results. How this issue can be resolved?

@0x1100010010
Copy link
Author

I was directly accessing localhost/miner.html which didn't have permissions on Go-server, hence the error. 2ndly it was meant to access from the search bar at the landing page with Miner login ID. Which fixes the problem. However, some times It is redirecting to MainPage, is it a bug?

@c0mm4nd
Copy link
Member

c0mm4nd commented Mar 14, 2020

Have you edit the config.js in web directory and replace the placeholder with your api address?

There shouldn't have any CORS error. Because the pool has header.Set("Access-Control-Allow-Origin", "*"), the requests from all sources are allowed.

@c0mm4nd c0mm4nd closed this as completed Jun 21, 2020
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

2 participants