hapijs / hapijs/hapi

Include the raw query string for the custom parser

Open
#4,189 4 comments 0 reactions 0 assignees View on GitHub
feature
Dominant language
JavaScript
Stars
14.8k
Forks
1.4k
Avg merge
22d 3h
Merged PRs (30d)
1

Description

#### Support plan

* *is this issue currently blocking your project?* (yes/no): no
* *is this issue affecting a production system?* (yes/no): no

#### Context

* *node version*: 14
* *module version*: 19
* *environment* (e.g. node, browser, native): node
* *used with* (e.g. hapi application, another framework, standalone, ...): hapi
* *any other relevant information*: using qs for query string parsing

#### What problem are you trying to solve?

I would like to send complex data in the query string. This includes nulls. The current preprocessing of the querystring will turn null objects properties into empty strings. More details and examples can be found here: https://github.com/ljharb/qs#handling-of-null-values

Currently the work around is to dig into the raw request in the handler and pull out the url and parse it myself. It would be nice if there was a second parameter on the custom parser to pass in the raw query string with no preprocessing done to it.

#### Do you have a new or modified API suggestion to solve the problem?
Test and working if you would like I can PR it.
https://github.com/efbenson/hapi/commit/5903cd510bc2dd47d3289e2089f2838fb9a9df27

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.