@sveltejs/adapter-netlify 2.0.6 → 2.0.7
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/files/esm/serverless.js +24 -18
- package/files/esm/shims.js +3517 -4694
- package/package.json +6 -5
package/files/esm/serverless.js
CHANGED
|
@@ -14,11 +14,11 @@ import 'stream/web';
|
|
|
14
14
|
import 'worker_threads';
|
|
15
15
|
import 'perf_hooks';
|
|
16
16
|
import 'util/types';
|
|
17
|
-
import 'url';
|
|
18
17
|
import 'events';
|
|
19
18
|
import 'tls';
|
|
20
19
|
import 'async_hooks';
|
|
21
20
|
import 'console';
|
|
21
|
+
import 'url';
|
|
22
22
|
import 'zlib';
|
|
23
23
|
import 'string_decoder';
|
|
24
24
|
import 'crypto';
|
|
@@ -119,24 +119,30 @@ function parse(input, options) {
|
|
|
119
119
|
}
|
|
120
120
|
}
|
|
121
121
|
|
|
122
|
-
if (input.headers
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
122
|
+
if (input.headers) {
|
|
123
|
+
if (typeof input.headers.getSetCookie === "function") {
|
|
124
|
+
// for fetch responses - they combine headers of the same type in the headers array,
|
|
125
|
+
// but getSetCookie returns an uncombined array
|
|
126
|
+
input = input.headers.getSetCookie();
|
|
127
|
+
} else if (input.headers["set-cookie"]) {
|
|
128
|
+
// fast-path for node.js (which automatically normalizes header names to lower-case
|
|
129
|
+
input = input.headers["set-cookie"];
|
|
130
|
+
} else {
|
|
131
|
+
// slow-path for other environments - see #25
|
|
132
|
+
var sch =
|
|
133
|
+
input.headers[
|
|
134
|
+
Object.keys(input.headers).find(function (key) {
|
|
135
|
+
return key.toLowerCase() === "set-cookie";
|
|
136
|
+
})
|
|
137
|
+
];
|
|
138
|
+
// warn if called on a request-like object with a cookie header rather than a set-cookie header - see #34, 36
|
|
139
|
+
if (!sch && input.headers.cookie && !options.silent) {
|
|
140
|
+
console.warn(
|
|
141
|
+
"Warning: set-cookie-parser appears to have been called on a request object. It is designed to parse Set-Cookie headers from responses, not Cookie headers from requests. Set the option {silent: true} to suppress this warning."
|
|
142
|
+
);
|
|
143
|
+
}
|
|
144
|
+
input = sch;
|
|
138
145
|
}
|
|
139
|
-
input = sch;
|
|
140
146
|
}
|
|
141
147
|
if (!Array.isArray(input)) {
|
|
142
148
|
input = [input];
|