Skip to content

Commit

Permalink
Relax style-src CSP
Browse files Browse the repository at this point in the history
  • Loading branch information
quietbits committed Mar 4, 2025
1 parent 026d0fe commit cb42bc3
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 13 deletions.
9 changes: 2 additions & 7 deletions src/app/(sidebar)/smart-contracts/contract-explorer/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -128,13 +128,8 @@ export default function ContractExplorer() {
<form
onSubmit={(e) => {
e.preventDefault();

try {
fetchContractInfo();
smartContracts.updateExplorerContractId(contractIdInput);
} catch (e) {
// Do nothing
}
fetchContractInfo();
smartContracts.updateExplorerContractId(contractIdInput);
}}
className="ContractExplorer__form"
>
Expand Down
1 change: 0 additions & 1 deletion src/components/CodeEditor/index.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import { useEffect, useRef, useState } from "react";
import { Button, CopyText, Icon } from "@stellar/design-system";
import MonacoEditor, { useMonaco } from "@monaco-editor/react";

import { useStore } from "@/store/useStore";
import { Box } from "@/components/layout/Box";

Expand Down
6 changes: 1 addition & 5 deletions src/middleware.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,7 @@ export function middleware(request: NextRequest) {
const cspHeader = `
default-src 'self';
script-src 'self' 'nonce-${nonce}' 'strict-dynamic' https: 'unsafe-inline' 'unsafe-eval';
style-src 'self' https://fonts.googleapis.com https: ${
process.env.NODE_ENV === "production"
? `'nonce-${nonce}'`
: `'unsafe-inline'`
};
style-src 'self' https: 'unsafe-inline';
img-src 'self' https://stellar.creit.tech/wallet-icons/ blob: data:;
connect-src 'self' http://localhost:* https:;
font-src 'self' https://fonts.gstatic.com/ https://cdn.jsdelivr.net/npm/[email protected]/min/vs/base/browser/ui/codicons/codicon/codicon.ttf;
Expand Down

0 comments on commit cb42bc3

Please sign in to comment.