Skip to content

Conversation

@ghostd
Copy link
Contributor

@ghostd ghostd commented Jan 30, 2021

Checklist

Closes #145

Copy link
Member

@mcollina mcollina left a comment

Choose a reason for hiding this comment

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

lgtm

index.js Outdated
}
}

if (!allowedPath(pathname, options.root)) {
Copy link
Member

Choose a reason for hiding this comment

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

With this check, it would be possible to skip the function declaration and the function call that returns true

Suggested change
if (!allowedPath(pathname, options.root)) {
if (allowedPath && !allowedPath(pathname, options.root)) {

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done

index.js Outdated
maxAge: opts.maxAge
}

const allowedPath = opts.allowedPath || allowAllPaths
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
const allowedPath = opts.allowedPath || allowAllPaths
const allowedPath = opts.allowedPath

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done

Copy link
Member

@mcollina mcollina left a comment

Choose a reason for hiding this comment

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

lgtm

@mcollina mcollina merged commit 9a2e352 into fastify:master Feb 18, 2021
@ghostd ghostd deleted the gh-145 branch February 18, 2021 16:36
@ghost ghost mentioned this pull request Mar 5, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Support filtering files by extension

3 participants