Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor: remove unused bindings #417

Merged
merged 1 commit into from
Oct 22, 2023
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
4 changes: 2 additions & 2 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -498,7 +498,7 @@ function findIndexFile (pathname, root, indexFiles = ['index.html']) {
try {
const stats = statSync(p)
return !stats.isDirectory()
} catch (e) {
} catch {
return false
}
})
Expand Down Expand Up @@ -542,7 +542,7 @@ function getRedirectUrl (url) {
const parsed = new URL(url, 'http://localhost.com/')
const parsedPathname = parsed.pathname
return parsedPathname + (parsedPathname[parsedPathname.length - 1] !== '/' ? '/' : '') + (parsed.search || '')
} catch (error) {
} catch {
// the try-catch here is actually unreachable, but we keep it for safety and prevent DoS attack
/* istanbul ignore next */
const err = new Error(`Invalid redirect URL: ${url}`)
Expand Down
6 changes: 3 additions & 3 deletions lib/dirList.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ const dirList = {
let stats
try {
stats = await fs.stat(path.join(dir, filename))
} catch (error) {
} catch {
return
}
const entry = { name: filename, stats }
Expand Down Expand Up @@ -58,7 +58,7 @@ const dirList = {
let stats
try {
stats = await fs.stat(filePath)
} catch (error) {
} catch {
return
}

Expand Down Expand Up @@ -112,7 +112,7 @@ const dirList = {
let entries
try {
entries = await dirList.list(dir, options, dotfiles)
} catch (error) {
} catch {
return reply.callNotFound()
}
const format = reply.request.query.format || options.format
Expand Down
Loading