GithubHelp home page GithubHelp logo

isabella232 / querystring-strict Goto Github PK

View Code? Open in Web Editor NEW

This project forked from koajs/querystring-strict

0.0 0.0 0.0 11 KB

THIS REPOSITORY IS NOW DEPRECATED

License: Other

JavaScript 100.00%

querystring-strict's Introduction

THIS REPOSITORY IS NOW DEPRECATED

This module had been merged into koa-qs, please use the first mode.

require('koa-qs')(app, 'first')

querystring-strict

NPM version build status appveyor build status Test coverage Gittip David deps iojs version node version npm download

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 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
console.log('%j', this.query.p);
["a,b", "b,c"]
  • after patch
console.log('%j', this.query.p);
"a,b"

Install

$ npm i koa-querystring-strict

Usage

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

License

MIT

querystring-strict's People

Contributors

fengmk2 avatar greenkeeperio-bot avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.