Cors

I am new to this fine service.

I created an account to use with a test project where the idea is to JavaScript fetch() to get data posted by users on various sites + a end user web-application where they can do work on the data served.

After setting up the free sub-domain and SSL I found that one can not do CORS requests. I.e:

<?php
header('Access-Control-Allow-Origin: https://example.com');
?>

is failing.

Then I read up and found Ensuring only web browsers can access your website

where it states:

AJAX requests from other websites (CORS). AJAX requests are only possible on the same (sub)domain.

My question is if this is absolute. Can one for example get an exemption or pay a (small ;P) amount to allow CORS? It is only for a set number of pages, that could expand like YouTube.

Unfortunately yes.

If you have a custom domain (you can also buy one if you want), you may be able to bypass the system by using an external DNS provider - like CloudFlare.

Alternatively, you could upgrade to premium hosting.

6 Likes

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.