Skip to content
This repository was archived by the owner on May 15, 2019. It is now read-only.

Commit c592053

Browse files
jmdobryAce Nassri
authored and
Ace Nassri
committed
1.0.0-beta.5 (#263)
1 parent 458f25d commit c592053

File tree

4 files changed

+30
-6
lines changed

4 files changed

+30
-6
lines changed

CHANGELOG.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,12 @@
1+
##### 1.0.0-beta.5 - 31 July 2018
2+
3+
###### Bug fixes
4+
- [#161](https://github.com/GoogleCloudPlatform/cloud-functions-emulator/issues/161) - The emulator behaves differently than the production version with respect to the rawBody property
5+
- [#261](https://github.com/GoogleCloudPlatform/cloud-functions-emulator/pull/261) - Update Node.js version warning message
6+
7+
###### Other
8+
- Updated dependencies
9+
110
##### 1.0.0-beta.4 - 06 March 2018
211

312
###### Bug fixes

CONTRIBUTORS

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,11 @@
33
# Names are formatted as:
44
# name <email>
55
#
6+
Ace Nassri <anassri@google.com>
67
Akinori Machino <akinori.machino@icloud.com>
78
Jason Dobry <jason.dobry@gmail.com>
89
Jason Polites <jason.polites@gmail.com>
10+
Justin Beckwith <justin.beckwith@gmail.com>
911
Kim Vogt <kim.vogt@gmail.com>
1012
Kris J. Pruden <kpruden@users.noreply.github.com>
1113
Lauren Long <laurenzlong@users.noreply.github.com>
@@ -15,3 +17,4 @@ Slawek Walkowski <swalkowski@users.noreply.github.com>
1517
Tim Swast <swast@google.com>
1618
Tina Liang <tinaliang@google.com>
1719
aminy <aminy@indicee.com>
20+
renovate[bot] <renovate[bot]@users.noreply.github.com>

package.json

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "@google-cloud/functions-emulator",
33
"description": "Google Cloud Functions Emulator",
4-
"version": "1.0.0-beta.4",
4+
"version": "1.0.0-beta.5",
55
"license": "Apache-2.0",
66
"author": "Google Inc.",
77
"engines": {
@@ -40,9 +40,11 @@
4040
]
4141
},
4242
"contributors": [
43+
"Ace Nassri <anassri@google.com>",
4344
"Akinori Machino <akinori.machino@icloud.com>",
4445
"Jason Dobry <jason.dobry@gmail.com>",
4546
"Jason Polites <jason.polites@gmail.com>",
47+
"Justin Beckwith <justin.beckwith@gmail.com>",
4648
"Kim Vogt <kim.vogt@gmail.com>",
4749
"Kris J. Pruden <kpruden@users.noreply.github.com>",
4850
"Lauren Long <laurenzlong@users.noreply.github.com>",
@@ -51,7 +53,8 @@
5153
"Slawek Walkowski <swalkowski@users.noreply.github.com>",
5254
"Tim Swast <swast@google.com>",
5355
"Tina Liang <tinaliang@google.com>",
54-
"aminy <aminy@indicee.com>"
56+
"aminy <aminy@indicee.com>",
57+
"renovate[bot] <renovate[bot]@users.noreply.github.com>"
5558
],
5659
"scripts": {
5760
"lint": "semistandard",

src/supervisor/worker.js

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -88,11 +88,17 @@ function main () {
8888
req.rawBody = buf;
8989
};
9090

91-
const rawBodySavingOptions = {
91+
const defaultBodySavingOptions = {
9292
limit: requestLimit,
9393
verify: rawBodySaver
9494
};
9595

96+
const rawBodySavingOptions = {
97+
limit: requestLimit,
98+
verify: rawBodySaver,
99+
type: '*/*'
100+
};
101+
96102
// Use extended query string parsing for URL-encoded bodies.
97103
const urlEncodedOptions = {
98104
limit: requestLimit,
@@ -101,11 +107,14 @@ function main () {
101107
};
102108

103109
// Parse request body
104-
app.use(bodyParser.raw(rawBodySavingOptions));
105-
app.use(bodyParser.json(rawBodySavingOptions));
106-
app.use(bodyParser.text(rawBodySavingOptions));
110+
app.use(bodyParser.json(defaultBodySavingOptions));
111+
app.use(bodyParser.text(defaultBodySavingOptions));
107112
app.use(bodyParser.urlencoded(urlEncodedOptions));
108113

114+
// MUST be last in the list of body parsers as subsequent parsers will be
115+
// skipped when one is matched.
116+
app.use(bodyParser.raw(rawBodySavingOptions));
117+
109118
// Never cache
110119
app.use((req, res, next) => {
111120
res.set('Cache-Control', 'no-cache, no-store, must-revalidate');

0 commit comments

Comments
 (0)