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

Commit

Permalink
1.0.0-beta.5 (#263)
Browse files Browse the repository at this point in the history
  • Loading branch information
jmdobry authored and Ace Nassri committed Aug 1, 2018
1 parent 458f25d commit c592053
Show file tree
Hide file tree
Showing 4 changed files with 30 additions and 6 deletions.
9 changes: 9 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,12 @@
##### 1.0.0-beta.5 - 31 July 2018

###### Bug fixes
- [#161](https://github.com/GoogleCloudPlatform/cloud-functions-emulator/issues/161) - The emulator behaves differently than the production version with respect to the rawBody property
- [#261](https://github.com/GoogleCloudPlatform/cloud-functions-emulator/pull/261) - Update Node.js version warning message

###### Other
- Updated dependencies

##### 1.0.0-beta.4 - 06 March 2018

###### Bug fixes
Expand Down
3 changes: 3 additions & 0 deletions CONTRIBUTORS
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,11 @@
# Names are formatted as:
# name <email>
#
Ace Nassri <anassri@google.com>
Akinori Machino <akinori.machino@icloud.com>
Jason Dobry <jason.dobry@gmail.com>
Jason Polites <jason.polites@gmail.com>
Justin Beckwith <justin.beckwith@gmail.com>
Kim Vogt <kim.vogt@gmail.com>
Kris J. Pruden <kpruden@users.noreply.github.com>
Lauren Long <laurenzlong@users.noreply.github.com>
Expand All @@ -15,3 +17,4 @@ Slawek Walkowski <swalkowski@users.noreply.github.com>
Tim Swast <swast@google.com>
Tina Liang <tinaliang@google.com>
aminy <aminy@indicee.com>
renovate[bot] <renovate[bot]@users.noreply.github.com>
7 changes: 5 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@google-cloud/functions-emulator",
"description": "Google Cloud Functions Emulator",
"version": "1.0.0-beta.4",
"version": "1.0.0-beta.5",
"license": "Apache-2.0",
"author": "Google Inc.",
"engines": {
Expand Down Expand Up @@ -40,9 +40,11 @@
]
},
"contributors": [
"Ace Nassri <anassri@google.com>",
"Akinori Machino <akinori.machino@icloud.com>",
"Jason Dobry <jason.dobry@gmail.com>",
"Jason Polites <jason.polites@gmail.com>",
"Justin Beckwith <justin.beckwith@gmail.com>",
"Kim Vogt <kim.vogt@gmail.com>",
"Kris J. Pruden <kpruden@users.noreply.github.com>",
"Lauren Long <laurenzlong@users.noreply.github.com>",
Expand All @@ -51,7 +53,8 @@
"Slawek Walkowski <swalkowski@users.noreply.github.com>",
"Tim Swast <swast@google.com>",
"Tina Liang <tinaliang@google.com>",
"aminy <aminy@indicee.com>"
"aminy <aminy@indicee.com>",
"renovate[bot] <renovate[bot]@users.noreply.github.com>"
],
"scripts": {
"lint": "semistandard",
Expand Down
17 changes: 13 additions & 4 deletions src/supervisor/worker.js
Original file line number Diff line number Diff line change
Expand Up @@ -88,11 +88,17 @@ function main () {
req.rawBody = buf;
};

const rawBodySavingOptions = {
const defaultBodySavingOptions = {
limit: requestLimit,
verify: rawBodySaver
};

const rawBodySavingOptions = {
limit: requestLimit,
verify: rawBodySaver,
type: '*/*'
};

// Use extended query string parsing for URL-encoded bodies.
const urlEncodedOptions = {
limit: requestLimit,
Expand All @@ -101,11 +107,14 @@ function main () {
};

// Parse request body
app.use(bodyParser.raw(rawBodySavingOptions));
app.use(bodyParser.json(rawBodySavingOptions));
app.use(bodyParser.text(rawBodySavingOptions));
app.use(bodyParser.json(defaultBodySavingOptions));
app.use(bodyParser.text(defaultBodySavingOptions));
app.use(bodyParser.urlencoded(urlEncodedOptions));

// MUST be last in the list of body parsers as subsequent parsers will be
// skipped when one is matched.
app.use(bodyParser.raw(rawBodySavingOptions));

// Never cache
app.use((req, res, next) => {
res.set('Cache-Control', 'no-cache, no-store, must-revalidate');
Expand Down

0 comments on commit c592053

Please sign in to comment.