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

feat: Allow passing query parser implementation in route config #4455

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
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
feat: Allow passing query parser implementation for application/x-www…
…-form-urlencoded data in payload options
  • Loading branch information
aarne committed Jul 29, 2023
commit 5889a909463d6d10e004f5f855824fc2227467a6
3 changes: 2 additions & 1 deletion lib/config.js
Original file line number Diff line number Diff line change
@@ -160,7 +160,8 @@ internals.routeBase = Validate.object({
defaultContentType: Validate.string().default('application/json'),
compression: Validate.object()
.pattern(/.+/, Validate.object())
.default()
.default(),
querystring: Validate.function(),
})
.default(),
plugins: Validate.object(),
6 changes: 6 additions & 0 deletions lib/types/route.d.ts
Original file line number Diff line number Diff line change
@@ -334,6 +334,12 @@ export interface RouteOptionsPayload {
* [See docs](https://github.com/hapijs/hapi/blob/master/API.md#-routeoptionspayloaduploads)
*/
uploads?: string | undefined;

/**
* @default Querystring.parse().
* Query parser implementation fro application/x-www-form-urlencoded data
*/
querystring?: (query: string) => { [key: string]: unknown };
}

/**