# koa-querystring-strict

> This patches a koa app with `this.query.foo` return strict `string`. Disable multi values.

Latest version **1.0.0** (published 2015-02-27) · MIT license · 0 weekly downloads

## Install

```sh
npm install koa-querystring-strict
pnpm add koa-querystring-strict
yarn add koa-querystring-strict
bun add koa-querystring-strict
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.0 |
| Published | 2015-02-27 |
| First published | 2015-02-27 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Node | >=0.11.14 |
| Dependencies | 1 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 1 |
| Author | fengmk2 |
| Maintainers | fengmk2 |
| Keywords | querystring-strict |

## Links

- npm: https://www.npmjs.com/package/koa-querystring-strict
- Repository: https://github.com/koajs/querystring-strict
- Issues: https://github.com/koajs/querystring-strict/issues
- npm.io page: https://npm.io/package/koa-querystring-strict

## Dependencies (1)

- [merge-descriptors](https://npm.io/package/merge-descriptors.md) ~0.0.2

## Alternatives

- [gamedig](https://npm.io/package/gamedig.md) — 29.3K weekly downloads
- [join-monster](https://npm.io/package/join-monster.md) — 12.8K weekly downloads
- [masked](https://npm.io/package/masked.md) — 5.5K weekly downloads
- [@comunica/actor-query-process-explain-logical](https://npm.io/package/@comunica/actor-query-process-explain-logical.md) — 4.7K weekly downloads
- [@veracity/vui](https://npm.io/package/@veracity/vui.md) — 4.6K weekly downloads

## Recent versions

- 1.0.0 (latest) — 2015-02-27

## README

# THIS REPOSITORY IS NOW DEPRECATED

This module had been merged into [koa-qs](https://github.com/koajs/qs), please use the `strict` mode.

```js
require('koa-qs')(app, 'strict')
```

querystring-strict
=======

[![NPM version][npm-image]][npm-url]
[![build status][travis-image]][travis-url]
[![appveyor build status][appveyor-image]][appveyor-url]
[![Test coverage][coveralls-image]][coveralls-url]
[![Gittip][gittip-image]][gittip-url]
[![David deps][david-image]][david-url]
[![iojs version][iojs-image]][iojs-url]
[![node version][node-image]][node-url]
[![npm download][download-image]][download-url]

[npm-image]: https://img.shields.io/npm/v/koa-querystring-strict.svg?style=flat-square
[npm-url]: https://npmjs.org/package/koa-querystring-strict
[travis-image]: https://img.shields.io/travis/koajs/querystring-strict.svg?style=flat-square
[travis-url]: https://travis-ci.org/koajs/querystring-strict
[appveyor-image]: https://ci.appveyor.com/api/projects/status/ija0bd5d7esb54x3?svg=true
[appveyor-url]: https://ci.appveyor.com/project/fengmk2/querystring-strict
[coveralls-image]: https://img.shields.io/coveralls/koajs/querystring-strict.svg?style=flat-square
[coveralls-url]: https://coveralls.io/r/koajs/querystring-strict?branch=master
[gittip-image]: https://img.shields.io/gittip/fengmk2.svg?style=flat-square
[gittip-url]: https://www.gittip.com/fengmk2/
[david-image]: https://img.shields.io/david/koajs/querystring-strict.svg?style=flat-square
[david-url]: https://david-dm.org/koajs/querystring-strict
[iojs-image]: https://img.shields.io/badge/io.js-%3E=_1.0-yellow.svg?style=flat-square
[iojs-url]: http://iojs.org/
[node-image]: https://img.shields.io/badge/node.js-%3E=_0.11-green.svg?style=flat-square
[node-url]: http://nodejs.org/download/
[download-image]: https://img.shields.io/npm/dm/koa-querystring-strict.svg?style=flat-square
[download-url]: https://npmjs.org/package/koa-querystring-strict

This patches a koa app with `this.query.foo` return strict `string`. Disable multi values.

In 95% use cases, application only want `string` query params.

This patch can avoid some stupid `TypeError` and some security issues like [MongoDB inject](http://www.wooyun.org/bugs/wooyun-2010-086474)
when the developers forget handling query params type check.

## What's different

A normal request `GET /foo?p=a,b&p=b,c`.

- before patch

```js
console.log('%j', this.query.p);
["a,b", "b,c"]
```

- after patch

```js
console.log('%j', this.query.p);
"a,b"
```

## Install

```bash
$ npm i koa-querystring-strict
```

## Usage

```js
var koa = require('koa');
var app = koa();
require('koa-querystring-strict')(app);
```

## License

[MIT](LICENSE)

---
_Source: https://npm.io/package/koa-querystring-strict · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
