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

Added request to allowedPath option #321

Merged
merged 4 commits into from
Jul 30, 2022
Merged

Added request to allowedPath option #321

merged 4 commits into from
Jul 30, 2022

Conversation

gurumaxi
Copy link
Contributor

@gurumaxi gurumaxi commented Jul 10, 2022

Added request to allowedPath option in order to allow more complex path validation.
Closes #319

index.d.ts Outdated
@@ -83,7 +83,7 @@ export interface FastifyStaticOptions extends SendOptions {
redirect?: boolean;
wildcard?: boolean;
list?: boolean | ListOptionsJsonFormat | ListOptionsHtmlFormat;
allowedPath?: (pathName: string, root?: string) => boolean;
allowedPath?: (pathName: string, root?: string, request: FastifyRequest) => boolean;
Copy link
Member

Choose a reason for hiding this comment

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

We also test our types. Could you update them too? Thanks!

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

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.

CI is failing

@mcollina
Copy link
Member

Could you please rebase?

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
Copy link
Member

Tests are failing

@Eomm Eomm merged commit 663b24d into fastify:master Jul 30, 2022
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.

Add request object to allowedPath option
3 participants