Fixed subdomains

This commit is contained in:
Nathan Dinsmore 2014-05-05 08:20:09 -04:00
parent fa42953d58
commit 993d10aaad
2 changed files with 3 additions and 3 deletions

View file

@ -28,9 +28,9 @@ var IO = function() {
// since we won't be hampered by the same-origin policy.
this.base = 'proxy.php?resource=internalapi/';
//this.base = 'http://scratch.mit.edu/internalapi/'; // Final base
this.project_base = this.base + 'project/';
this.project_base = 'proxy.php?domain=projects.scratch.mit.edu&resource=internalapi/project/';
this.project_suffix = '/get/';
this.asset_base = this.base + 'asset/';
this.asset_base = 'proxy.php?domain=cdn.scratch.mit.edu&resource=internalapi/asset/';
this.asset_suffix = '/get/';
this.soundbank_base = 'soundbank/';
this.spriteLayerCount = 0;

View file

@ -6,7 +6,7 @@
* proxy.php should be removed from the server.
*/
$resource = 'http://scratch.mit.edu/' . $_GET['resource'];
$resource = 'http://' . (isset($_GET['domain']) ? $_GET['domain'] : 'scratch.mit.edu') . '/' . $_GET['resource'];
// Strip the /get/ suffix for calculating the extension
// and then get the file extension to pass on to the browser.