Skip to content

Commit

Permalink
try wildcard
Browse files Browse the repository at this point in the history
  • Loading branch information
pomdtr committed Dec 7, 2023
1 parent 5e660fd commit 2328423
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 8 deletions.
2 changes: 1 addition & 1 deletion frontend/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<link rel="stylesheet" href="./src/styles.css" />
<link id="favicon" rel="icon" href="./logo.svg" />
<meta http-equiv="Content-Security-Policy" id="CSP"
content="default-src 'self'; script-src 'self'; style-src 'self'; connect-src 'self' ws://localhost:9999 http://localhost:9999">
content="default-src 'self'; script-src 'self'; style-src 'self'; connect-src 'self' ws://localhost:* http://localhost:*">
<meta http-equiv="X-XSS-Protection" content="1; mode=block">
<meta http-equiv="X-Content-Type-Options" content="nosniff">
<title>Terminal</title>
Expand Down
8 changes: 1 addition & 7 deletions frontend/src/terminal.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,7 @@ async function main() {
const params = new URLSearchParams(window.location.search);
let origin: URL
if (params.has("port")) {
const portNumber = params.get("port")
const csp = document.getElementById("CSP")
if (!csp) {
throw new Error("CSP meta tag not found")
}
csp.setAttribute("content", `default-src 'self'; script-src 'self'; style-src 'self'; connect-src 'self' ws://localhost:${portNumber} http://localhost:${portNumber}`)
origin = new URL(`http://localhost:${portNumber}`)
origin = new URL(`http://localhost:${params.get("port")}`)
} else if (__TWEETY_ORIGIN__) {
origin = new URL(__TWEETY_ORIGIN__)
} else {
Expand Down

0 comments on commit 2328423

Please sign in to comment.