Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
"url": "git+https://github.com/opencor/webapp.git"
},
"type": "module",
"version": "0.20260330.0",
"version": "0.20260330.1",
"engines": {
"bun": ">=1.2.0"
},
Expand Down
6 changes: 5 additions & 1 deletion src/extern/corsProxy.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,12 @@ export default {

const parsedUrl = new URL(targetUrl);
const allowedHosts = ['cellml.org', 'opencor.ws', 'physiomeproject.org'];
const allowedExtensions = ['.cellml', '.sedml', '.omex', '.csv'];

if (!allowedHosts.some((host) => parsedUrl.hostname.endsWith(host))) {
if (
!allowedHosts.some((host) => parsedUrl.hostname.endsWith(host)) &&
!allowedExtensions.some((extension) => parsedUrl.pathname.toLowerCase().endsWith(extension))
) {
return new Response('Target URL is not allowed.', { status: 403 });
}

Expand Down
2 changes: 1 addition & 1 deletion src/renderer/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
},
"./style.css": "./dist/opencor.css"
},
"version": "0.20260330.0",
"version": "0.20260330.1",
"scripts": {
"build": "vite build && bun scripts/generate.version.js",
"build:lib": "vite build --config vite.lib.config.ts && bunx --bun vue-tsc --project tsconfig.lib.types.json",
Expand Down
Loading