How do I remove the Access-Control-Allow-Origin in preview?

Get help using Construct 2

Post » Wed May 27, 2015 5:27 pm

How do I remove the Access-Control-Allow-Origin restrictions in preview?

Is this even possible?
https://www.ravenheart.ca/home
I don't check the forums much anymore, but I will receive an email for PMs.

"Someone once told me I bite off more than I can chew...

I told them I would rather choke on greatness than nibble on mediocrity."
B
23
S
6
G
1
Posts: 1,419
Reputation: 4,857

Post » Wed May 27, 2015 10:07 pm

Have two seperate serverside php files and set which one to use based on a variable?
B
54
S
7
G
8
Posts: 150
Reputation: 5,817

Post » Thu May 28, 2015 10:46 am

I'm not sure exactly what you're referring to, but the same-origin/CORS security stuff is an important part of security on the web, so you can't just get rid of it.
Scirra Founder
B
399
S
236
G
89
Posts: 24,530
Reputation: 195,402

Post » Thu May 28, 2015 5:14 pm

Well, I do want it in place for the export version, but I was having trouble with the proxy-accessible files on the preview mode.

I found a way around it though, so this was a possible solution that I asked about.
https://www.ravenheart.ca/home
I don't check the forums much anymore, but I will receive an email for PMs.

"Someone once told me I bite off more than I can chew...

I told them I would rather choke on greatness than nibble on mediocrity."
B
23
S
6
G
1
Posts: 1,419
Reputation: 4,857

Post » Tue Mar 08, 2016 8:05 am

gumshoe2029 wrote:Well, I do want it in place for the export version, but I was having trouble with the proxy-accessible files on the preview mode.

I found a way around it though, so this was a possible solution that I asked about.


What solution did you find @gumshoe2029? I am facing the same problem and I don't want to publish every time in order to test my app.

Thank you!
B
4
Posts: 5
Reputation: 269

Post » Tue Mar 08, 2016 10:10 am

Old topic, but for general info, I use this Chrome extension https://chrome.google.com/webstore/deta ... ajignpffnh
This will enable/disable Access-Control-Allow-Origin
@abinop
B
82
S
21
G
23
Posts: 517
Reputation: 18,731

Post » Wed Mar 09, 2016 8:22 pm

abinop wrote:
gumshoe2029 wrote:Well, I do want it in place for the export version, but I was having trouble with the proxy-accessible files on the preview mode.

I found a way around it though, so this was a possible solution that I asked about.


What solution did you find @gumshoe2029? I am facing the same problem and I don't want to publish every time in order to test my app.

Thank you!


I had to add this line of code to my servlets to fix it:
response.setHeader("Access-Control-Allow-Origin", "*");

I will eventually be removing this tag from our production servers, since the client and server are not the same in production, but on my local test machine I run both the server and the client on the same machine.
https://www.ravenheart.ca/home
I don't check the forums much anymore, but I will receive an email for PMs.

"Someone once told me I bite off more than I can chew...

I told them I would rather choke on greatness than nibble on mediocrity."
B
23
S
6
G
1
Posts: 1,419
Reputation: 4,857


Return to How do I....?

Who is online

Users browsing this forum: Baidu [Spider], R0J0hound and 21 guests