serverless-offline 12.0.1 → 12.0.2

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/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "dedicatedTo": "Blue, a great migrating bird.",
3
3
  "name": "serverless-offline",
4
- "version": "12.0.1",
4
+ "version": "12.0.2",
5
5
  "description": "Emulate AWS λ and API Gateway locally when developing your Serverless project",
6
6
  "license": "MIT",
7
7
  "exports": {
@@ -82,13 +82,13 @@
82
82
  ]
83
83
  },
84
84
  "dependencies": {
85
- "@aws-sdk/client-lambda": "^3.224.0",
85
+ "@aws-sdk/client-lambda": "^3.226.0",
86
86
  "@hapi/boom": "^10.0.0",
87
87
  "@hapi/h2o2": "^10.0.0",
88
88
  "@hapi/hapi": "^21.1.0",
89
89
  "@serverless/utils": "^6.8.2",
90
90
  "boxen": "^7.0.0",
91
- "chalk": "^5.1.2",
91
+ "chalk": "^5.2.0",
92
92
  "execa": "^6.1.0",
93
93
  "fs-extra": "^11.1.0",
94
94
  "is-wsl": "^2.2.0",
@@ -118,9 +118,9 @@
118
118
  "git-list-updated": "^1.2.1",
119
119
  "husky": "^8.0.2",
120
120
  "lint-staged": "^13.1.0",
121
- "mocha": "^10.1.0",
121
+ "mocha": "^10.2.0",
122
122
  "nyc": "^15.1.0",
123
- "prettier": "^2.8.0",
123
+ "prettier": "^2.8.1",
124
124
  "serverless": "^3.25.1",
125
125
  "standard-version": "^9.5.0"
126
126
  },
@@ -22,8 +22,6 @@ export default class HttpServer {
22
22
 
23
23
  #server = null
24
24
 
25
- #lastRequestOptions = null
26
-
27
25
  #terminalInfo = []
28
26
 
29
27
  constructor(serverless, options, lambda) {
@@ -140,7 +138,7 @@ export default class HttpServer {
140
138
  }
141
139
 
142
140
  async start() {
143
- const { host, albPort, httpsProtocol } = this.#options
141
+ const { albPort, host, httpsProtocol } = this.#options
144
142
 
145
143
  try {
146
144
  await this.#server.start()
@@ -172,13 +170,6 @@ export default class HttpServer {
172
170
  const { functionKey, method, stage } = params
173
171
 
174
172
  return async (request, h) => {
175
- this.#lastRequestOptions = {
176
- headers: request.headers,
177
- method: request.method,
178
- payload: request.payload,
179
- url: request.url.href,
180
- }
181
-
182
173
  const requestPath = this.#options.noPrependStageInUrl
183
174
  ? request.path
184
175
  : request.path.substr(`/${stage}`.length)
@@ -322,7 +313,11 @@ export default class HttpServer {
322
313
  })
323
314
 
324
315
  const hapiMethod = method === 'ANY' ? '*' : method
325
- const hapiOptions = {}
316
+ const hapiOptions = {
317
+ response: {
318
+ emptyStatusCode: 200,
319
+ },
320
+ }
326
321
 
327
322
  // skip HEAD routes as hapi will fail with 'Method name not allowed: HEAD ...'
328
323
  // for more details, check https://github.com/dherault/serverless-offline/issues/204
@@ -1045,6 +1045,9 @@ export default class HttpServer {
1045
1045
  const hapiOptions = {
1046
1046
  auth: authStrategyName,
1047
1047
  cors,
1048
+ response: {
1049
+ emptyStatusCode: 200,
1050
+ },
1048
1051
  state,
1049
1052
  timeout: {
1050
1053
  socket: false,
@@ -1201,7 +1204,9 @@ export default class HttpServer {
1201
1204
  }
1202
1205
 
1203
1206
  if (hapiMethod !== 'GET' && hapiMethod !== 'HEAD') {
1204
- hapiOptions.payload = { parse: false }
1207
+ hapiOptions.payload = {
1208
+ parse: false,
1209
+ }
1205
1210
  }
1206
1211
 
1207
1212
  log.notice(`${method} ${hapiPath} -> ${proxyUriInUse}`)