diff --git a/readme.md b/readme.md index 2228ca8..62f2380 100644 --- a/readme.md +++ b/readme.md @@ -126,12 +126,22 @@ You may also pass a sub-application, which _must_ be accompanied by a `base` pat Please see [`Middleware`](#middleware) and [Express' middleware examples](http://expressjs.com/en/4x/api.html#middleware-callback-function-examples) for more info. -### parse(req) +### parse(req, toDecode=true) Returns: `Object` or `undefined` As of `v0.5.0`, this is an alias of the [`@polka/url`](/packages/url) module. For nearly all cases, you'll notice no changes. +One important difference is that URL decoding is enabled by default in polka but it is disabled by default in the `@polka/url` module. You can disable the URL decoding if required, + +```js +const app = polka(); +const { parse } = require('@polka/url'); +app.parse = (req, toDecode) => { + return parse(req, false); // or simply, return parse(req); +} +``` + But, for whatever reason, you can quickly swap in [`parseurl`](https://github.com/pillarjs/parseurl) again: ```js @@ -140,6 +150,8 @@ app.parse = require('parseurl'); //=> Done! ``` +> **Note:** `parseurl` doesn't support URL decoding yet. + ### listen() Returns: `Polka`