openlearn-next 0.3.2 → 0.3.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/assets/{BatchPickerModal-VYKUF5TC.js → BatchPickerModal-2jsnyMYM.js} +1 -1
- package/dist/assets/{ClassesView-dDPegGIu.js → ClassesView-DUnZ5nFa.js} +1 -1
- package/dist/assets/{CloudDriveModal-DiEEoAK5.js → CloudDriveModal-DXJktxoq.js} +1 -1
- package/dist/assets/{CourseManagement-Dys0J3Xl.js → CourseManagement-ChHr_wNd.js} +1 -1
- package/dist/assets/{CourseWizardModal-DFZzYcbL.js → CourseWizardModal-RAaltA_q.js} +1 -1
- package/dist/assets/{Dashboard-Bnxuy2BQ.js → Dashboard-BMXQhpnj.js} +1 -1
- package/dist/assets/{ExportWeightModal-DPriCEO9.js → ExportWeightModal-BwW76Kqo.js} +1 -1
- package/dist/assets/{HelpView-CTErIWbE.js → HelpView-BqUqq-QE.js} +1 -1
- package/dist/assets/{ImportLessonsModal-BleM5Z-r.js → ImportLessonsModal-DHLxg68P.js} +1 -1
- package/dist/assets/{InteractiveCoursewareViewer-DBCbyDmo.js → InteractiveCoursewareViewer-C8uZcebL.js} +1 -1
- package/dist/assets/{InteractiveWhiteboard-DnnYVSpP.js → InteractiveWhiteboard-C2HAx6zv.js} +1 -1
- package/dist/assets/{LazyCourseware-BtliMSwD.js → LazyCourseware-C1bH8aKj.js} +1 -1
- package/dist/assets/{LazyWhiteboard-D_U3t5Ft.js → LazyWhiteboard-DE9sMBUF.js} +1 -1
- package/dist/assets/{LessonEditorView-Lejw223i.js → LessonEditorView-mIxHUfYb.js} +1 -1
- package/dist/assets/{LiveClassroomView-DW7gWs1X.js → LiveClassroomView-DNGZaCC8.js} +1 -1
- package/dist/assets/{NotificationDetailModal-me41YjnW.js → NotificationDetailModal-CPrHxHcC.js} +1 -1
- package/dist/assets/{PluginView-pof_3sut.js → PluginView-DSLBfNDj.js} +1 -1
- package/dist/assets/{QuizGeneratorModal-UEVoYkB6.js → QuizGeneratorModal-CoeGXKck.js} +1 -1
- package/dist/assets/{StudentAssignmentView-BTfMYbmx.js → StudentAssignmentView-V7Kp6TnP.js} +1 -1
- package/dist/assets/{StudentLessonView-Bb5HQ6Kx.js → StudentLessonView-IZVXM5kz.js} +1 -1
- package/dist/assets/{StudentPreviewModal-Bx86ogm7.js → StudentPreviewModal-DwumAjWX.js} +1 -1
- package/dist/assets/{StudentView-5bdEpjwh.js → StudentView-3mCaDwFB.js} +1 -1
- package/dist/assets/{SystemResourceLibraryModal-CRsieL1o.js → SystemResourceLibraryModal-B6ms798K.js} +1 -1
- package/dist/assets/{TeacherView-DCTHvypF.js → TeacherView-BVd_ZMFH.js} +1 -1
- package/dist/assets/{index-CerSuw-h.js → index-Cwf8LQbY.js} +3 -3
- package/dist/assets/{index-Bve0X_Y7.js → index-Vr-_Vpp3.js} +1 -1
- package/dist/index.html +1 -1
- package/dist/server.cjs +45 -14
- package/package.json +1 -1
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/index-B-YxO39A.css"])))=>i.map(i=>d[i]);
|
|
2
|
-
import{_ as e}from"./vendor-pdf-Cp-cYteE.js";import{r as t}from"./vendor-react-0Lg0vA-4.js";const i=t.lazy(()=>e(()=>import("./InteractiveCoursewareViewer-
|
|
2
|
+
import{_ as e}from"./vendor-pdf-Cp-cYteE.js";import{r as t}from"./vendor-react-0Lg0vA-4.js";const i=t.lazy(()=>e(()=>import("./InteractiveCoursewareViewer-C8uZcebL.js"),__vite__mapDeps([0])).then(r=>({default:r.InteractiveCoursewareViewer})));export{i as CoursewareViewer};
|
package/dist/index.html
CHANGED
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
}
|
|
16
16
|
}
|
|
17
17
|
</script>
|
|
18
|
-
<script type="module" crossorigin src="/assets/index-
|
|
18
|
+
<script type="module" crossorigin src="/assets/index-Cwf8LQbY.js"></script>
|
|
19
19
|
<link rel="stylesheet" crossorigin href="/assets/index-B-YxO39A.css">
|
|
20
20
|
</head>
|
|
21
21
|
<body>
|
package/dist/server.cjs
CHANGED
|
@@ -24540,6 +24540,36 @@ async function startServer() {
|
|
|
24540
24540
|
app.use(import_express3.default.urlencoded({ limit: "10mb", extended: true }));
|
|
24541
24541
|
app.use("/uploads", import_express3.default.static(import_path15.default.join(process.cwd(), "uploads")));
|
|
24542
24542
|
app.use("/plugins", import_express3.default.static(import_path15.default.join(process.cwd(), "plugins")));
|
|
24543
|
+
const configuredOrigins = process.env.ALLOWED_ORIGINS ? process.env.ALLOWED_ORIGINS.split(",").map((s) => s.trim()).filter(Boolean) : [];
|
|
24544
|
+
const isOriginAllowed = (origin, hostHeader) => {
|
|
24545
|
+
if (!origin) return true;
|
|
24546
|
+
if (configuredOrigins.length > 0) {
|
|
24547
|
+
if (configuredOrigins.includes("*") || configuredOrigins.includes(origin)) {
|
|
24548
|
+
return true;
|
|
24549
|
+
}
|
|
24550
|
+
}
|
|
24551
|
+
if (hostHeader) {
|
|
24552
|
+
try {
|
|
24553
|
+
const originUrl = new URL(origin);
|
|
24554
|
+
if (originUrl.host === hostHeader) {
|
|
24555
|
+
return true;
|
|
24556
|
+
}
|
|
24557
|
+
} catch {
|
|
24558
|
+
}
|
|
24559
|
+
}
|
|
24560
|
+
try {
|
|
24561
|
+
const originUrl = new URL(origin);
|
|
24562
|
+
const hostname = originUrl.hostname;
|
|
24563
|
+
if (hostname === "localhost" || hostname === "127.0.0.1" || hostname === "[::1]" || hostname === "0.0.0.0") {
|
|
24564
|
+
return true;
|
|
24565
|
+
}
|
|
24566
|
+
} catch {
|
|
24567
|
+
}
|
|
24568
|
+
if (process.env.NODE_ENV !== "production") {
|
|
24569
|
+
return true;
|
|
24570
|
+
}
|
|
24571
|
+
return false;
|
|
24572
|
+
};
|
|
24543
24573
|
app.use((req, res, next) => {
|
|
24544
24574
|
const origin = req.headers.origin;
|
|
24545
24575
|
if (origin === "null" || origin === void 0) {
|
|
@@ -24547,6 +24577,12 @@ async function startServer() {
|
|
|
24547
24577
|
res.setHeader("Access-Control-Allow-Methods", "GET, POST, PUT, DELETE, PATCH, OPTIONS");
|
|
24548
24578
|
res.setHeader("Access-Control-Allow-Headers", "Content-Type, Authorization, X-Requested-With");
|
|
24549
24579
|
res.setHeader("Access-Control-Max-Age", "86400");
|
|
24580
|
+
} else if (isOriginAllowed(origin, req.headers.host)) {
|
|
24581
|
+
res.setHeader("Access-Control-Allow-Origin", origin);
|
|
24582
|
+
res.setHeader("Access-Control-Allow-Credentials", "true");
|
|
24583
|
+
res.setHeader("Access-Control-Allow-Methods", "GET, POST, PUT, DELETE, PATCH, OPTIONS");
|
|
24584
|
+
res.setHeader("Access-Control-Allow-Headers", "Content-Type, Authorization, X-Requested-With");
|
|
24585
|
+
res.setHeader("Access-Control-Max-Age", "86400");
|
|
24550
24586
|
}
|
|
24551
24587
|
if (req.method === "OPTIONS") {
|
|
24552
24588
|
return res.sendStatus(204);
|
|
@@ -24569,21 +24605,16 @@ async function startServer() {
|
|
|
24569
24605
|
activityRegistry
|
|
24570
24606
|
};
|
|
24571
24607
|
const httpServer = (0, import_http.createServer)(app);
|
|
24572
|
-
const allowedOrigins = process.env.ALLOWED_ORIGINS ? process.env.ALLOWED_ORIGINS.split(",").map((s) => s.trim()) : process.env.NODE_ENV === "production" ? [] : ["http://localhost:5173", "http://localhost:9000", "http://localhost:4173"];
|
|
24573
24608
|
const io = new import_socket.Server(httpServer, {
|
|
24574
|
-
cors: {
|
|
24575
|
-
|
|
24576
|
-
|
|
24577
|
-
|
|
24578
|
-
|
|
24579
|
-
|
|
24580
|
-
|
|
24581
|
-
|
|
24582
|
-
|
|
24583
|
-
return callback(new Error("Not allowed by CORS"));
|
|
24584
|
-
},
|
|
24585
|
-
methods: ["GET", "POST"],
|
|
24586
|
-
credentials: true
|
|
24609
|
+
cors: (req, callback) => {
|
|
24610
|
+
const origin = req.headers.origin;
|
|
24611
|
+
const host = req.headers.host;
|
|
24612
|
+
const allowed = isOriginAllowed(origin, host);
|
|
24613
|
+
callback(null, {
|
|
24614
|
+
origin: allowed ? origin || true : false,
|
|
24615
|
+
methods: ["GET", "POST"],
|
|
24616
|
+
credentials: true
|
|
24617
|
+
});
|
|
24587
24618
|
}
|
|
24588
24619
|
});
|
|
24589
24620
|
io.use((socket, next) => {
|