EtienneLamoureux / sc-trade-tools

Issues repository for SC Trade Tools
http://sc-trade.tools
24 stars 4 forks source link

Fix POST requests over HTTPS fail with 403 "Invalid CORS request" #10

Closed hyunh90 closed 4 years ago

hyunh90 commented 4 years ago

Site functionality is completely broken with below error: image

Environment

Steps to reproduce

Expected output

The tool lists potential best buyers.

Actual output

The tool fails to load with aforementioned error.

EtienneLamoureux commented 4 years ago

Thank you for the detailed report.

Can you reproduce the issue when using the Mirror?

This error message is consistent with an impossibility to reach the server, which I expect to happen in the early days of DNS propagation. It's only been ~18h since the last name servers change, so one call might reach and the next fail. Additionally, I'm currently in the process of setting up end-to-end SSL encryption, but for the moment it is only active between the client and the content-delivery-network solution, which is why some HTTPS calls still fail: some calls resolve with the old nameservers, and as end-to-end SSL is not yet configured, those calls fail.

This is a problem though, and I'll rectify it.

hyunh90 commented 4 years ago

Yup, on the mirror it works just fine.

EtienneLamoureux commented 4 years ago
I ran some tests. Results: Network Protocol Result
Origin server directly HTTP 200 OK
Through cloudflare HTTP 200 OK
Through cloudflare HTTPS 403 "Invalid CORS request"
EtienneLamoureux commented 4 years ago

The joys of CORS. Should be all good now.