@yopdev/dev-server 3.0.2-RC2 → 3.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.
|
@@ -9,6 +9,7 @@ on:
|
|
|
9
9
|
|
|
10
10
|
jobs:
|
|
11
11
|
build:
|
|
12
|
+
timeout-minutes: 5
|
|
12
13
|
runs-on: ubuntu-latest
|
|
13
14
|
steps:
|
|
14
15
|
- uses: actions/checkout@v4
|
|
@@ -20,6 +21,7 @@ jobs:
|
|
|
20
21
|
|
|
21
22
|
publish-npm:
|
|
22
23
|
needs: build
|
|
24
|
+
timeout-minutes: 5
|
|
23
25
|
runs-on: ubuntu-latest
|
|
24
26
|
steps:
|
|
25
27
|
- uses: actions/checkout@v4
|
package/dist/src/mappers.js
CHANGED
|
@@ -82,6 +82,7 @@ class DefaultLambdaMapper {
|
|
|
82
82
|
pathParameters: null,
|
|
83
83
|
queryStringParameters: this.queryStringParameters,
|
|
84
84
|
resource: '',
|
|
85
|
+
cookies: this.cookieHeaderValue?.split(';') || [],
|
|
85
86
|
multiValueHeaders: {},
|
|
86
87
|
isBase64Encoded: false,
|
|
87
88
|
multiValueQueryStringParameters: null,
|
|
@@ -149,8 +150,11 @@ class DefaultLambdaMapper {
|
|
|
149
150
|
headers['accept'] = request.headers['accept'];
|
|
150
151
|
if (request.headers['origin'])
|
|
151
152
|
headers['origin'] = request.headers['origin'];
|
|
152
|
-
|
|
153
|
-
|
|
153
|
+
const cookieHeaderValue = request.headers['cookie'];
|
|
154
|
+
if (cookieHeaderValue) {
|
|
155
|
+
headers['cookie'] = cookieHeaderValue;
|
|
156
|
+
this.cookieHeaderValue = cookieHeaderValue;
|
|
157
|
+
}
|
|
154
158
|
const authorizationHeaderValue = request.headers['authorization'];
|
|
155
159
|
if (authorizationHeaderValue) {
|
|
156
160
|
headers['authorization'] = authorizationHeaderValue;
|
package/package.json
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@yopdev/dev-server",
|
|
3
|
-
"version": "3.0.2
|
|
3
|
+
"version": "3.0.2",
|
|
4
4
|
"scripts": {
|
|
5
5
|
"compile": "tsc",
|
|
6
6
|
"pretest": "npm run compile",
|
|
7
|
-
"test": "jest",
|
|
7
|
+
"test": "jest --maxConcurrency=1 --maxWorkers=1",
|
|
8
8
|
"clean": "rm -rf dist",
|
|
9
9
|
"predistclean": "npm run clean",
|
|
10
10
|
"distclean": "rm -rf node_modules"
|
package/src/mappers.ts
CHANGED
|
@@ -65,6 +65,7 @@ class DefaultLambdaMapper<AuthorizerContext> implements LambdaMapper<AuthorizerC
|
|
|
65
65
|
private readonly method: string
|
|
66
66
|
private readonly queryStringParameters: APIGatewayProxyEventQueryStringParameters
|
|
67
67
|
private readonly headers: APIGatewayProxyEventHeaders
|
|
68
|
+
private readonly cookieHeaderValue: string | undefined
|
|
68
69
|
|
|
69
70
|
constructor(request: IncomingMessage, private readonly body: string) {
|
|
70
71
|
if (!request.url || !request.method) throw new Error('url and method are required');
|
|
@@ -79,7 +80,11 @@ class DefaultLambdaMapper<AuthorizerContext> implements LambdaMapper<AuthorizerC
|
|
|
79
80
|
if (request.headers['content-type']) headers['content-type'] = request.headers['content-type'];
|
|
80
81
|
if (request.headers['accept']) headers['accept'] = request.headers['accept'];
|
|
81
82
|
if (request.headers['origin']) headers['origin'] = request.headers['origin'];
|
|
82
|
-
|
|
83
|
+
const cookieHeaderValue = request.headers['cookie'];
|
|
84
|
+
if (cookieHeaderValue) {
|
|
85
|
+
headers['cookie'] = cookieHeaderValue;
|
|
86
|
+
this.cookieHeaderValue = cookieHeaderValue;
|
|
87
|
+
}
|
|
83
88
|
const authorizationHeaderValue = request.headers['authorization']
|
|
84
89
|
if (authorizationHeaderValue) {
|
|
85
90
|
headers['authorization'] = authorizationHeaderValue;
|
|
@@ -127,6 +132,7 @@ class DefaultLambdaMapper<AuthorizerContext> implements LambdaMapper<AuthorizerC
|
|
|
127
132
|
pathParameters: null,
|
|
128
133
|
queryStringParameters: this.queryStringParameters,
|
|
129
134
|
resource: '',
|
|
135
|
+
cookies: this.cookieHeaderValue?.split(';') || [],
|
|
130
136
|
multiValueHeaders: {},
|
|
131
137
|
isBase64Encoded: false,
|
|
132
138
|
multiValueQueryStringParameters: null,
|