Skip to content

Commit

Permalink
Merge pull request #1900 from trilitech/fix-offboard-error
Browse files Browse the repository at this point in the history
Fix desktop offboarding
  • Loading branch information
serjonya-trili authored Sep 17, 2024
2 parents 8918598 + c7cba13 commit de03d6d
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions apps/desktop/public/electron.js
Original file line number Diff line number Diff line change
Expand Up @@ -69,17 +69,17 @@ function createWindow() {
protocol.handle(APP_PROTOCOL, async req => {
try {
const uri = new URL(decodeURI(req.url));

const pathname = uri.pathname === "/" ? "/index.html" : uri.pathname;
if (
req.url.includes("..") || // relative paths aren't allowed
uri.protocol !== `${APP_PROTOCOL}:` || // protocol mismatch
!uri.pathname || // path must be defined
uri.pathname === "/" || // path must not be root
!pathname || // path must be defined
uri.host !== APP_HOST // host must match
) {
return new Response("Invalid request", { status: 400 });
}
const pathToServe = path.join(__dirname, uri.pathname);

const pathToServe = path.join(__dirname, pathname);
const relativePath = path.relative(__dirname, pathToServe);
if (!(relativePath && !relativePath.startsWith("..") && !path.isAbsolute(relativePath))) {
return new Response("Invalid request", { status: 400 });
Expand Down

1 comment on commit de03d6d

@github-actions
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Title Lines Statements Branches Functions
apps/desktop Coverage: 83%
83.79% (1758/2098) 78.94% (825/1045) 78.45% (448/571)
apps/web Coverage: 83%
83.79% (1758/2098) 78.94% (825/1045) 78.45% (448/571)
packages/components Coverage: 97%
97.1% (134/138) 96.49% (55/57) 82.92% (34/41)
packages/core Coverage: 82%
82.89% (223/269) 73.18% (101/138) 81.35% (48/59)
packages/crypto Coverage: 100%
100% (28/28) 100% (3/3) 100% (5/5)
packages/data-polling Coverage: 98%
96.55% (140/145) 95.45% (21/22) 92.85% (39/42)
packages/multisig Coverage: 98%
98.47% (129/131) 89.47% (17/19) 100% (35/35)
packages/social-auth Coverage: 100%
100% (21/21) 100% (11/11) 100% (3/3)
packages/state Coverage: 84%
83.64% (772/923) 80.78% (164/203) 78.22% (291/372)
packages/tezos Coverage: 86%
85.57% (89/104) 89.47% (17/19) 82.75% (24/29)
packages/tzkt Coverage: 86%
84.05% (58/69) 81.25% (13/16) 76.92% (30/39)

Please sign in to comment.