Skip to content

Commit 18df7ff

Browse files
committed
fixed www. trimmage so sandbox works on devbasherwo.org and www.devbasherwo.org
1 parent 31733cf commit 18df7ff

File tree

2 files changed

+2
-4
lines changed

2 files changed

+2
-4
lines changed

ide/routes.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -169,9 +169,6 @@ def idejs_static():
169169
if auth.check_auth_host_for_preview(host_name): # are we running in a preview?
170170
ide_js = ide_js.replace('WEBSERVER_NAME_TEMPLATE',host_name)
171171
ide_js = ide_js.replace('SANDBOX_PREFIX_TEMPLATE','https://') # no sandbox
172-
elif host_name.startswith('www.'):
173-
ide_js = ide_js.replace('WEBSERVER_NAME_TEMPLATE',host_name[4:])
174-
ide_js = ide_js.replace('SANDBOX_PREFIX_TEMPLATE','https://sandbox.')
175172
else:
176173
ide_js = ide_js.replace('WEBSERVER_NAME_TEMPLATE',host_name)
177174
ide_js = ide_js.replace('SANDBOX_PREFIX_TEMPLATE','https://sandbox.')

untrusted/run.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,10 @@ var weblocs = [/^https:\/\/glowscript\.org$/, // put a couple of these explicitl
1111

1212
function checkTrustedHosts(aHost) { // go through the known trusted hosts
1313
let found = false;
14+
let trimhost = aHost.replace('www.','') // remove www. if it's there
1415
//console.log("checking trusted hosts:" + aHost);
1516
for (let i = 0; i < weblocs.length; i++) {
16-
found = aHost.match(weblocs[i]);
17+
found = trimhost.match(weblocs[i]);
1718
if (found) {
1819
break;
1920
}

0 commit comments

Comments
 (0)