forked from snap-cloud/snapCloud
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcors.lua
66 lines (64 loc) · 2.58 KB
/
cors.lua
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
-- CORS module
-- ==========
--
-- A list of whitelisted domains that we support.
--
-- Written by Bernat Romagosa and Michael Ball
--
-- Copyright (C) 2019 by Bernat Romagosa and Michael Ball
--
-- This file is part of Snap Cloud.
--
-- Snap Cloud is free software: you can redistribute it and/or modify
-- it under the terms of the GNU Affero General Public License as
-- published by the Free Software Foundation, either version 3 of
-- the License, or (at your option) any later version.
--
-- This program is distributed in the hope that it will be useful,
-- but WITHOUT ANY WARRANTY; without even the implied warranty of
-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-- GNU Affero General Public License for more details.
--
-- You should have received a copy of the GNU Affero General Public License
-- along with this program. If not, see <http://www.gnu.org/licenses/>.
local domain_allowed = {}
domain_allowed['snap.berkeley.edu'] = true
domain_allowed['amazingrobots.net'] = true
domain_allowed['snap4arduino.rocks'] = true
-- This domain serves an HTTP only Snap! IDE
domain_allowed['extensions.snap.berkeley.edu'] = true
-- Snap4Arduino for Chromebooks
domain_allowed['chrome-extension://bdmapaboflkhdmcgdpfooeeeadejodia'] = true
domain_allowed['chrome-extension://ghipaghphhpfncbokoobcjlapbnceipg'] = true
-- App Server Domains
-- By Default CORS is not needed on the same domain.
-- However, we want to allow access on http hosted versions of Snap!.
domain_allowed['snap-cloud.cs10.org'] = true
domain_allowed['cloud.snap.berkeley.edu'] = true
-- App Server Staging Domains
domain_allowed['snap-staging.cs10.org'] = true
domain_allowed['staging.snap.berkeley.edu'] = true
-- Snap! Mirrors
domain_allowed['cs10.org'] = true
domain_allowed['bjc.edc.org'] = true
domain_allowed['web.media.mit.edu'] = true
-- Snap! Research Projects
domain_allowed['eliza.csc.ncsu.edu'] = true
domain_allowed['arena.csc.ncsu.edu'] = true
domain_allowed['stemc.csc.ncsu.edu'] = true
domain_allowed['lambda.cs10.org'] = true
-- All edX Sites, and test sites
domain_allowed['courses.edge.edx.org'] = true
domain_allowed['courses.edx.org'] = true
domain_allowed['d37djvu3ytnwxt.cloudfront.net'] = true
domain_allowed['preview.courses.edge.edx.org'] = true
domain_allowed['preview.courses.edx.org'] = true
domain_allowed['preview.edge.edx.org'] = true
domain_allowed['preview.edx.org'] = true
domain_allowed['studio.edge.edx.org'] = true
domain_allowed['studio.edx.org'] = true
domain_allowed['edge.edx.org'] = true
-- Development
domain_allowed['romagosa.work'] = true
domain_allowed['localhost'] = true
return domain_allowed