@middy/http-urlencode-path-parser 4.0.0-alpha.4 → 4.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +0 -53
- package/package.json +3 -3
package/README.md
CHANGED
|
@@ -36,59 +36,6 @@
|
|
|
36
36
|
<p>You can read the documentation at: <a href="https://middy.js.org/docs/middlewares/http-urlencode-path-parser">https://middy.js.org/docs/middlewares/http-urlencode-path-parser</a></p>
|
|
37
37
|
</div>
|
|
38
38
|
|
|
39
|
-
This middleware automatically parses HTTP requests with URL-encoded paths. This can happen when using path variables (ie `/{name}/`) for an endpoint and the UI `encodeURIComponent` the values before making the request.
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
## Install
|
|
43
|
-
|
|
44
|
-
To install this middleware you can use NPM:
|
|
45
|
-
|
|
46
|
-
```bash
|
|
47
|
-
npm install --save @middy/http-urlencode-path-parser
|
|
48
|
-
```
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
## Options
|
|
52
|
-
None
|
|
53
|
-
|
|
54
|
-
## Sample usage
|
|
55
|
-
|
|
56
|
-
```javascript
|
|
57
|
-
import middy from '@middy/core'
|
|
58
|
-
import httpUrlEncodePathParser from '@middy/http-urlencode-path-parser'
|
|
59
|
-
|
|
60
|
-
const handler = middy((event, context) => {
|
|
61
|
-
return event.body // propagates the body as response
|
|
62
|
-
})
|
|
63
|
-
|
|
64
|
-
handler.use(httpUrlEncodePathParser())
|
|
65
|
-
|
|
66
|
-
// When Lambda runs the handler with a sample event...
|
|
67
|
-
const event = {
|
|
68
|
-
|
|
69
|
-
pathParameters: {
|
|
70
|
-
name: encodeURIComponent('Mîddy')
|
|
71
|
-
}
|
|
72
|
-
}
|
|
73
|
-
|
|
74
|
-
handler(event, {}, (_, body) => {
|
|
75
|
-
t.deepEqual(body, {
|
|
76
|
-
name: 'Mîddy'
|
|
77
|
-
})
|
|
78
|
-
})
|
|
79
|
-
```
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
## Middy documentation and examples
|
|
83
|
-
|
|
84
|
-
For more documentation and examples, refers to the main [Middy monorepo on GitHub](https://github.com/middyjs/middy) or [Middy official website](https://middy.js.org).
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
## Contributing
|
|
88
|
-
|
|
89
|
-
Everyone is very welcome to contribute to this repository. Feel free to [raise issues](https://github.com/middyjs/middy/issues) or to [submit Pull Requests](https://github.com/middyjs/middy/pulls).
|
|
90
|
-
|
|
91
|
-
|
|
92
39
|
## License
|
|
93
40
|
|
|
94
41
|
Licensed under [MIT License](LICENSE). Copyright (c) 2017-2022 [Luciano Mammino](https://github.com/lmammino), [will Farrell](https://github.com/willfarrell), and the [Middy team](https://github.com/middyjs/middy/graphs/contributors).
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@middy/http-urlencode-path-parser",
|
|
3
|
-
"version": "4.0.
|
|
3
|
+
"version": "4.0.1",
|
|
4
4
|
"description": "Urlencode path parser middleware for the middy framework",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"engines": {
|
|
@@ -63,9 +63,9 @@
|
|
|
63
63
|
},
|
|
64
64
|
"homepage": "https://middy.js.org",
|
|
65
65
|
"devDependencies": {
|
|
66
|
-
"@middy/core": "4.0.
|
|
66
|
+
"@middy/core": "4.0.1",
|
|
67
67
|
"@types/aws-lambda": "^8.10.101",
|
|
68
68
|
"type-fest": "^3.0.0"
|
|
69
69
|
},
|
|
70
|
-
"gitHead": "
|
|
70
|
+
"gitHead": "c5ece2bfbb0d607dcdea5685bf194a6cc19acc8d"
|
|
71
71
|
}
|