https://github.com/olsonpm/koa-decoded-querystring
https://github.com/olsonpm/koa-decoded-querystring
Last synced: 16 days ago
JSON representation
- Host: GitHub
- URL: https://github.com/olsonpm/koa-decoded-querystring
- Owner: olsonpm
- Created: 2016-06-09T07:40:00.000Z (almost 10 years ago)
- Default Branch: master
- Last Pushed: 2016-06-14T01:44:56.000Z (almost 10 years ago)
- Last Synced: 2025-02-08T23:04:31.849Z (over 1 year ago)
- Language: JavaScript
- Size: 2.93 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Koa Decoded Querystring
## To use
```js
const koaDecodedQuerystring = require('koa-decoded-querystring');
// ...
app.use(koaDecodedQuerystring());
```
## Very Simple
This module is 5 lines long
```js
// call function to allow for future options as advised by koa best-practices
module.exports = () =>
(ctx, next) => {
ctx.decodedQuerystring = decodeURIComponent(ctx.querystring);
return next();
};
```
So when ctx.querystring contains "%20", decodedQuerystring will contain a
space instead
I only created this module to isolate the testing and any further additions.