serverless-offline 11.0.3 → 11.1.0

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 CHANGED
@@ -195,10 +195,6 @@ Turns off all authorizers.
195
195
 
196
196
  Don't prepend http routes with the stage.
197
197
 
198
- #### noStripTrailingSlashInUrl
199
-
200
- Don't strip trailing slash from http routes.
201
-
202
198
  #### noTimeout
203
199
 
204
200
  -t Disables the timeout feature.
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": "11.0.3",
4
+ "version": "11.1.0",
5
5
  "description": "Emulate AWS λ and API Gateway locally when developing your Serverless project",
6
6
  "license": "MIT",
7
7
  "exports": {
@@ -86,7 +86,7 @@
86
86
  "@hapi/h2o2": "^10.0.0",
87
87
  "@hapi/hapi": "^20.2.2",
88
88
  "@serverless/utils": "^6.7.0",
89
- "aws-sdk": "^2.1230.0",
89
+ "aws-sdk": "^2.1231.0",
90
90
  "boxen": "^7.0.0",
91
91
  "chalk": "^5.1.0",
92
92
  "execa": "^6.1.0",
@@ -101,7 +101,7 @@
101
101
  "node-fetch": "^3.2.10",
102
102
  "node-schedule": "^2.1.0",
103
103
  "object.hasown": "^1.1.1",
104
- "p-memoize": "^7.1.0",
104
+ "p-memoize": "^7.1.1",
105
105
  "p-retry": "^5.1.1",
106
106
  "velocityjs": "^2.0.6",
107
107
  "ws": "^8.9.0"
@@ -109,7 +109,7 @@
109
109
  "devDependencies": {
110
110
  "@istanbuljs/esm-loader-hook": "^0.2.0",
111
111
  "archiver": "^5.3.1",
112
- "eslint": "^8.24.0",
112
+ "eslint": "^8.25.0",
113
113
  "eslint-config-airbnb-base": "^15.0.0",
114
114
  "eslint-config-prettier": "^8.5.0",
115
115
  "eslint-plugin-import": "^2.25.4",
@@ -85,10 +85,6 @@ export default {
85
85
  type: 'boolean',
86
86
  usage: "Don't prepend http routes with the stage.",
87
87
  },
88
- noStripTrailingSlashInUrl: {
89
- type: 'boolean',
90
- usage: "Don't strip trailing slash from http routes.",
91
- },
92
88
  noTimeout: {
93
89
  shortcut: 't',
94
90
  type: 'boolean',
@@ -17,7 +17,6 @@ export default {
17
17
  localEnvironment: false,
18
18
  noAuth: false,
19
19
  noPrependStageInUrl: false,
20
- noStripTrailingSlashInUrl: false,
21
20
  noTimeout: false,
22
21
  prefix: '',
23
22
  reloadHandler: false,
@@ -68,22 +68,12 @@ export default class HttpServer {
68
68
  }
69
69
 
70
70
  async createServer() {
71
- const {
72
- enforceSecureCookies,
73
- host,
74
- httpPort,
75
- httpsProtocol,
76
- noStripTrailingSlashInUrl,
77
- } = this.#options
71
+ const { enforceSecureCookies, host, httpPort, httpsProtocol } =
72
+ this.#options
78
73
 
79
74
  const serverOptions = {
80
75
  host,
81
76
  port: httpPort,
82
- router: {
83
- // allows for paths with trailing slashes to be the same as without
84
- // e.g. : /my-path is the same as /my-path/
85
- stripTrailingSlash: !noStripTrailingSlashInUrl,
86
- },
87
77
  state: enforceSecureCookies
88
78
  ? {
89
79
  isHttpOnly: true,
@@ -35,11 +35,6 @@ export default class HttpServer {
35
35
  const serverOptions = {
36
36
  host,
37
37
  port: websocketPort,
38
- router: {
39
- // allows for paths with trailing slashes to be the same as without
40
- // e.g. : /my-path is the same as /my-path/
41
- stripTrailingSlash: true,
42
- },
43
38
  // https support
44
39
  ...(httpsProtocol != null && {
45
40
  tls: await this.#loadCerts(httpsProtocol),
@@ -12,11 +12,7 @@ export default function generateHapiPath(path, options, serverless) {
12
12
  hapiPath = `/${options.prefix}${hapiPath}`
13
13
  }
14
14
 
15
- if (
16
- hapiPath !== '/' &&
17
- hapiPath.endsWith('/') &&
18
- (!options.noStripTrailingSlashInUrl || hapiPath.endsWith('+}/'))
19
- ) {
15
+ if (hapiPath !== '/' && hapiPath.endsWith('/') && hapiPath.endsWith('+}/')) {
20
16
  hapiPath = hapiPath.slice(0, -1)
21
17
  }
22
18