Skip to content

Commit

Permalink
Ignore test coverage for no longer covered check about directory trav…
Browse files Browse the repository at this point in the history
…ersal
  • Loading branch information
yhatt committed Sep 15, 2024
1 parent 3f2e0f5 commit f4e871c
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -224,9 +224,12 @@ export class Server extends (EventEmitter as new () => TypedEmitter<Server.Event
const baseDir = path.resolve(this.inputDir)
const targetPath = path.join(baseDir, decodeURIComponent(relativePath))

// This test is no longer covered by updated express, but still remaining for security
if (!targetPath.startsWith(baseDir)) {
/* c8 ignore start */
// Skip remaining process to prevent check for unexpected file and directory
return { valid: false, path: targetPath }
/* c8 ignore end */
}

// Check file stat
Expand Down

0 comments on commit f4e871c

Please sign in to comment.