@adonisjs/http-server 8.0.0-next.13 → 8.0.0-next.15
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/build/{define_config-DpDqx7A4.js → define_config-Dh5SpqNg.js} +500 -7
- package/build/factories/main.js +3 -3
- package/build/factories/request.d.ts +1 -1
- package/build/factories/response.d.ts +1 -1
- package/build/factories/router.d.ts +1 -1
- package/build/factories/server_factory.d.ts +1 -1
- package/build/factories/url_builder_factory.d.ts +1 -1
- package/build/{helpers-Dt-25M21.js → helpers-oKG4uNSM.js} +40 -14
- package/build/index.js +2 -2
- package/build/src/cookies/client.d.ts +1 -1
- package/build/src/cookies/drivers/encrypted.d.ts +1 -1
- package/build/src/cookies/drivers/signed.d.ts +1 -1
- package/build/src/cookies/parser.d.ts +1 -1
- package/build/src/cookies/serializer.d.ts +1 -1
- package/build/src/debug.d.ts +1 -1
- package/build/src/helpers.d.ts +1 -1
- package/build/src/helpers.js +1 -1
- package/build/src/qs.d.ts +1 -1
- package/build/src/request.d.ts +1 -1
- package/build/src/response.d.ts +3 -3
- package/build/src/router/main.d.ts +1 -1
- package/build/src/router/signed_url_builder.d.ts +1 -1
- package/build/src/server/main.d.ts +1 -1
- package/package.json +22 -23
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { D as __require, E as __export, O as __toESM, T as __commonJSMin, _ as Route, b as httpRequest, d as safeDecodeURI, f as toRoutesJSON, g as BriskRoute, h as RouteResource, l as serializeCookie, m as RouteGroup, n as createSignedURL, o as mime, p as trustProxy, r as encodeUrl, s as parseRoute, v as httpExceptionHandler, w as debug_default, x as httpResponseSerializer, y as httpMiddleware } from "./helpers-oKG4uNSM.js";
|
|
2
2
|
import { n as findRoute, t as createURL } from "./helpers-C_2HouOe.js";
|
|
3
3
|
import { t as createUrlBuilder } from "./url_builder-piNQy-CF.js";
|
|
4
|
-
import { parse, stringify } from "qs";
|
|
4
|
+
import { parse, stringify } from "@poppinss/qs";
|
|
5
5
|
import { Exception, RuntimeException, createError } from "@poppinss/utils/exception";
|
|
6
6
|
import { inspect } from "node:util";
|
|
7
7
|
import { parse as parse$1 } from "cookie-es";
|
|
@@ -14,7 +14,6 @@ import Middleware from "@poppinss/middleware";
|
|
|
14
14
|
import onFinished from "on-finished";
|
|
15
15
|
import fresh from "fresh";
|
|
16
16
|
import typeIs from "type-is";
|
|
17
|
-
import accepts from "accepts";
|
|
18
17
|
import { isIP } from "node:net";
|
|
19
18
|
import proxyAddr from "proxy-addr";
|
|
20
19
|
import { MessageBuilder, safeEqual } from "@poppinss/utils";
|
|
@@ -158,6 +157,499 @@ var Redirect = class {
|
|
|
158
157
|
this.#sendResponse(url, query);
|
|
159
158
|
}
|
|
160
159
|
};
|
|
160
|
+
var require_charset = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
161
|
+
module.exports = preferredCharsets$1;
|
|
162
|
+
module.exports.preferredCharsets = preferredCharsets$1;
|
|
163
|
+
var simpleCharsetRegExp = /^\s*([^\s;]+)\s*(?:;(.*))?$/;
|
|
164
|
+
function parseAcceptCharset(accept) {
|
|
165
|
+
var accepts$1 = accept.split(",");
|
|
166
|
+
for (var i = 0, j = 0; i < accepts$1.length; i++) {
|
|
167
|
+
var charset = parseCharset(accepts$1[i].trim(), i);
|
|
168
|
+
if (charset) accepts$1[j++] = charset;
|
|
169
|
+
}
|
|
170
|
+
accepts$1.length = j;
|
|
171
|
+
return accepts$1;
|
|
172
|
+
}
|
|
173
|
+
function parseCharset(str, i) {
|
|
174
|
+
var match = simpleCharsetRegExp.exec(str);
|
|
175
|
+
if (!match) return null;
|
|
176
|
+
var charset = match[1];
|
|
177
|
+
var q = 1;
|
|
178
|
+
if (match[2]) {
|
|
179
|
+
var params = match[2].split(";");
|
|
180
|
+
for (var j = 0; j < params.length; j++) {
|
|
181
|
+
var p = params[j].trim().split("=");
|
|
182
|
+
if (p[0] === "q") {
|
|
183
|
+
q = parseFloat(p[1]);
|
|
184
|
+
break;
|
|
185
|
+
}
|
|
186
|
+
}
|
|
187
|
+
}
|
|
188
|
+
return {
|
|
189
|
+
charset,
|
|
190
|
+
q,
|
|
191
|
+
i
|
|
192
|
+
};
|
|
193
|
+
}
|
|
194
|
+
function getCharsetPriority(charset, accepted, index) {
|
|
195
|
+
var priority = {
|
|
196
|
+
o: -1,
|
|
197
|
+
q: 0,
|
|
198
|
+
s: 0
|
|
199
|
+
};
|
|
200
|
+
for (var i = 0; i < accepted.length; i++) {
|
|
201
|
+
var spec = specify$3(charset, accepted[i], index);
|
|
202
|
+
if (spec && (priority.s - spec.s || priority.q - spec.q || priority.o - spec.o) < 0) priority = spec;
|
|
203
|
+
}
|
|
204
|
+
return priority;
|
|
205
|
+
}
|
|
206
|
+
function specify$3(charset, spec, index) {
|
|
207
|
+
var s = 0;
|
|
208
|
+
if (spec.charset.toLowerCase() === charset.toLowerCase()) s |= 1;
|
|
209
|
+
else if (spec.charset !== "*") return null;
|
|
210
|
+
return {
|
|
211
|
+
i: index,
|
|
212
|
+
o: spec.i,
|
|
213
|
+
q: spec.q,
|
|
214
|
+
s
|
|
215
|
+
};
|
|
216
|
+
}
|
|
217
|
+
function preferredCharsets$1(accept, provided) {
|
|
218
|
+
var accepts$1 = parseAcceptCharset(accept === void 0 ? "*" : accept || "");
|
|
219
|
+
if (!provided) return accepts$1.filter(isQuality$3).sort(compareSpecs$3).map(getFullCharset);
|
|
220
|
+
var priorities = provided.map(function getPriority(type, index) {
|
|
221
|
+
return getCharsetPriority(type, accepts$1, index);
|
|
222
|
+
});
|
|
223
|
+
return priorities.filter(isQuality$3).sort(compareSpecs$3).map(function getCharset(priority) {
|
|
224
|
+
return provided[priorities.indexOf(priority)];
|
|
225
|
+
});
|
|
226
|
+
}
|
|
227
|
+
function compareSpecs$3(a, b) {
|
|
228
|
+
return b.q - a.q || b.s - a.s || a.o - b.o || a.i - b.i || 0;
|
|
229
|
+
}
|
|
230
|
+
function getFullCharset(spec) {
|
|
231
|
+
return spec.charset;
|
|
232
|
+
}
|
|
233
|
+
function isQuality$3(spec) {
|
|
234
|
+
return spec.q > 0;
|
|
235
|
+
}
|
|
236
|
+
}));
|
|
237
|
+
var require_encoding = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
238
|
+
module.exports = preferredEncodings$1;
|
|
239
|
+
module.exports.preferredEncodings = preferredEncodings$1;
|
|
240
|
+
var simpleEncodingRegExp = /^\s*([^\s;]+)\s*(?:;(.*))?$/;
|
|
241
|
+
function parseAcceptEncoding(accept) {
|
|
242
|
+
var accepts$1 = accept.split(",");
|
|
243
|
+
var hasIdentity = false;
|
|
244
|
+
var minQuality = 1;
|
|
245
|
+
for (var i = 0, j = 0; i < accepts$1.length; i++) {
|
|
246
|
+
var encoding = parseEncoding(accepts$1[i].trim(), i);
|
|
247
|
+
if (encoding) {
|
|
248
|
+
accepts$1[j++] = encoding;
|
|
249
|
+
hasIdentity = hasIdentity || specify$2("identity", encoding);
|
|
250
|
+
minQuality = Math.min(minQuality, encoding.q || 1);
|
|
251
|
+
}
|
|
252
|
+
}
|
|
253
|
+
if (!hasIdentity) accepts$1[j++] = {
|
|
254
|
+
encoding: "identity",
|
|
255
|
+
q: minQuality,
|
|
256
|
+
i
|
|
257
|
+
};
|
|
258
|
+
accepts$1.length = j;
|
|
259
|
+
return accepts$1;
|
|
260
|
+
}
|
|
261
|
+
function parseEncoding(str, i) {
|
|
262
|
+
var match = simpleEncodingRegExp.exec(str);
|
|
263
|
+
if (!match) return null;
|
|
264
|
+
var encoding = match[1];
|
|
265
|
+
var q = 1;
|
|
266
|
+
if (match[2]) {
|
|
267
|
+
var params = match[2].split(";");
|
|
268
|
+
for (var j = 0; j < params.length; j++) {
|
|
269
|
+
var p = params[j].trim().split("=");
|
|
270
|
+
if (p[0] === "q") {
|
|
271
|
+
q = parseFloat(p[1]);
|
|
272
|
+
break;
|
|
273
|
+
}
|
|
274
|
+
}
|
|
275
|
+
}
|
|
276
|
+
return {
|
|
277
|
+
encoding,
|
|
278
|
+
q,
|
|
279
|
+
i
|
|
280
|
+
};
|
|
281
|
+
}
|
|
282
|
+
function getEncodingPriority(encoding, accepted, index) {
|
|
283
|
+
var priority = {
|
|
284
|
+
o: -1,
|
|
285
|
+
q: 0,
|
|
286
|
+
s: 0
|
|
287
|
+
};
|
|
288
|
+
for (var i = 0; i < accepted.length; i++) {
|
|
289
|
+
var spec = specify$2(encoding, accepted[i], index);
|
|
290
|
+
if (spec && (priority.s - spec.s || priority.q - spec.q || priority.o - spec.o) < 0) priority = spec;
|
|
291
|
+
}
|
|
292
|
+
return priority;
|
|
293
|
+
}
|
|
294
|
+
function specify$2(encoding, spec, index) {
|
|
295
|
+
var s = 0;
|
|
296
|
+
if (spec.encoding.toLowerCase() === encoding.toLowerCase()) s |= 1;
|
|
297
|
+
else if (spec.encoding !== "*") return null;
|
|
298
|
+
return {
|
|
299
|
+
i: index,
|
|
300
|
+
o: spec.i,
|
|
301
|
+
q: spec.q,
|
|
302
|
+
s
|
|
303
|
+
};
|
|
304
|
+
}
|
|
305
|
+
function preferredEncodings$1(accept, provided) {
|
|
306
|
+
var accepts$1 = parseAcceptEncoding(accept || "");
|
|
307
|
+
if (!provided) return accepts$1.filter(isQuality$2).sort(compareSpecs$2).map(getFullEncoding);
|
|
308
|
+
var priorities = provided.map(function getPriority(type, index) {
|
|
309
|
+
return getEncodingPriority(type, accepts$1, index);
|
|
310
|
+
});
|
|
311
|
+
return priorities.filter(isQuality$2).sort(compareSpecs$2).map(function getEncoding(priority) {
|
|
312
|
+
return provided[priorities.indexOf(priority)];
|
|
313
|
+
});
|
|
314
|
+
}
|
|
315
|
+
function compareSpecs$2(a, b) {
|
|
316
|
+
return b.q - a.q || b.s - a.s || a.o - b.o || a.i - b.i || 0;
|
|
317
|
+
}
|
|
318
|
+
function getFullEncoding(spec) {
|
|
319
|
+
return spec.encoding;
|
|
320
|
+
}
|
|
321
|
+
function isQuality$2(spec) {
|
|
322
|
+
return spec.q > 0;
|
|
323
|
+
}
|
|
324
|
+
}));
|
|
325
|
+
var require_language = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
326
|
+
module.exports = preferredLanguages$1;
|
|
327
|
+
module.exports.preferredLanguages = preferredLanguages$1;
|
|
328
|
+
var simpleLanguageRegExp = /^\s*([^\s\-;]+)(?:-([^\s;]+))?\s*(?:;(.*))?$/;
|
|
329
|
+
function parseAcceptLanguage(accept) {
|
|
330
|
+
var accepts$1 = accept.split(",");
|
|
331
|
+
for (var i = 0, j = 0; i < accepts$1.length; i++) {
|
|
332
|
+
var language = parseLanguage(accepts$1[i].trim(), i);
|
|
333
|
+
if (language) accepts$1[j++] = language;
|
|
334
|
+
}
|
|
335
|
+
accepts$1.length = j;
|
|
336
|
+
return accepts$1;
|
|
337
|
+
}
|
|
338
|
+
function parseLanguage(str, i) {
|
|
339
|
+
var match = simpleLanguageRegExp.exec(str);
|
|
340
|
+
if (!match) return null;
|
|
341
|
+
var prefix = match[1];
|
|
342
|
+
var suffix = match[2];
|
|
343
|
+
var full = prefix;
|
|
344
|
+
if (suffix) full += "-" + suffix;
|
|
345
|
+
var q = 1;
|
|
346
|
+
if (match[3]) {
|
|
347
|
+
var params = match[3].split(";");
|
|
348
|
+
for (var j = 0; j < params.length; j++) {
|
|
349
|
+
var p = params[j].split("=");
|
|
350
|
+
if (p[0] === "q") q = parseFloat(p[1]);
|
|
351
|
+
}
|
|
352
|
+
}
|
|
353
|
+
return {
|
|
354
|
+
prefix,
|
|
355
|
+
suffix,
|
|
356
|
+
q,
|
|
357
|
+
i,
|
|
358
|
+
full
|
|
359
|
+
};
|
|
360
|
+
}
|
|
361
|
+
function getLanguagePriority(language, accepted, index) {
|
|
362
|
+
var priority = {
|
|
363
|
+
o: -1,
|
|
364
|
+
q: 0,
|
|
365
|
+
s: 0
|
|
366
|
+
};
|
|
367
|
+
for (var i = 0; i < accepted.length; i++) {
|
|
368
|
+
var spec = specify$1(language, accepted[i], index);
|
|
369
|
+
if (spec && (priority.s - spec.s || priority.q - spec.q || priority.o - spec.o) < 0) priority = spec;
|
|
370
|
+
}
|
|
371
|
+
return priority;
|
|
372
|
+
}
|
|
373
|
+
function specify$1(language, spec, index) {
|
|
374
|
+
var p = parseLanguage(language);
|
|
375
|
+
if (!p) return null;
|
|
376
|
+
var s = 0;
|
|
377
|
+
if (spec.full.toLowerCase() === p.full.toLowerCase()) s |= 4;
|
|
378
|
+
else if (spec.prefix.toLowerCase() === p.full.toLowerCase()) s |= 2;
|
|
379
|
+
else if (spec.full.toLowerCase() === p.prefix.toLowerCase()) s |= 1;
|
|
380
|
+
else if (spec.full !== "*") return null;
|
|
381
|
+
return {
|
|
382
|
+
i: index,
|
|
383
|
+
o: spec.i,
|
|
384
|
+
q: spec.q,
|
|
385
|
+
s
|
|
386
|
+
};
|
|
387
|
+
}
|
|
388
|
+
function preferredLanguages$1(accept, provided) {
|
|
389
|
+
var accepts$1 = parseAcceptLanguage(accept === void 0 ? "*" : accept || "");
|
|
390
|
+
if (!provided) return accepts$1.filter(isQuality$1).sort(compareSpecs$1).map(getFullLanguage);
|
|
391
|
+
var priorities = provided.map(function getPriority(type, index) {
|
|
392
|
+
return getLanguagePriority(type, accepts$1, index);
|
|
393
|
+
});
|
|
394
|
+
return priorities.filter(isQuality$1).sort(compareSpecs$1).map(function getLanguage(priority) {
|
|
395
|
+
return provided[priorities.indexOf(priority)];
|
|
396
|
+
});
|
|
397
|
+
}
|
|
398
|
+
function compareSpecs$1(a, b) {
|
|
399
|
+
return b.q - a.q || b.s - a.s || a.o - b.o || a.i - b.i || 0;
|
|
400
|
+
}
|
|
401
|
+
function getFullLanguage(spec) {
|
|
402
|
+
return spec.full;
|
|
403
|
+
}
|
|
404
|
+
function isQuality$1(spec) {
|
|
405
|
+
return spec.q > 0;
|
|
406
|
+
}
|
|
407
|
+
}));
|
|
408
|
+
var require_mediaType = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
409
|
+
module.exports = preferredMediaTypes$1;
|
|
410
|
+
module.exports.preferredMediaTypes = preferredMediaTypes$1;
|
|
411
|
+
var simpleMediaTypeRegExp = /^\s*([^\s\/;]+)\/([^;\s]+)\s*(?:;(.*))?$/;
|
|
412
|
+
function parseAccept(accept) {
|
|
413
|
+
var accepts$1 = splitMediaTypes(accept);
|
|
414
|
+
for (var i = 0, j = 0; i < accepts$1.length; i++) {
|
|
415
|
+
var mediaType = parseMediaType(accepts$1[i].trim(), i);
|
|
416
|
+
if (mediaType) accepts$1[j++] = mediaType;
|
|
417
|
+
}
|
|
418
|
+
accepts$1.length = j;
|
|
419
|
+
return accepts$1;
|
|
420
|
+
}
|
|
421
|
+
function parseMediaType(str, i) {
|
|
422
|
+
var match = simpleMediaTypeRegExp.exec(str);
|
|
423
|
+
if (!match) return null;
|
|
424
|
+
var params = Object.create(null);
|
|
425
|
+
var q = 1;
|
|
426
|
+
var subtype = match[2];
|
|
427
|
+
var type = match[1];
|
|
428
|
+
if (match[3]) {
|
|
429
|
+
var kvps = splitParameters(match[3]).map(splitKeyValuePair);
|
|
430
|
+
for (var j = 0; j < kvps.length; j++) {
|
|
431
|
+
var pair = kvps[j];
|
|
432
|
+
var key = pair[0].toLowerCase();
|
|
433
|
+
var val = pair[1];
|
|
434
|
+
var value = val && val[0] === "\"" && val[val.length - 1] === "\"" ? val.substr(1, val.length - 2) : val;
|
|
435
|
+
if (key === "q") {
|
|
436
|
+
q = parseFloat(value);
|
|
437
|
+
break;
|
|
438
|
+
}
|
|
439
|
+
params[key] = value;
|
|
440
|
+
}
|
|
441
|
+
}
|
|
442
|
+
return {
|
|
443
|
+
type,
|
|
444
|
+
subtype,
|
|
445
|
+
params,
|
|
446
|
+
q,
|
|
447
|
+
i
|
|
448
|
+
};
|
|
449
|
+
}
|
|
450
|
+
function getMediaTypePriority(type, accepted, index) {
|
|
451
|
+
var priority = {
|
|
452
|
+
o: -1,
|
|
453
|
+
q: 0,
|
|
454
|
+
s: 0
|
|
455
|
+
};
|
|
456
|
+
for (var i = 0; i < accepted.length; i++) {
|
|
457
|
+
var spec = specify(type, accepted[i], index);
|
|
458
|
+
if (spec && (priority.s - spec.s || priority.q - spec.q || priority.o - spec.o) < 0) priority = spec;
|
|
459
|
+
}
|
|
460
|
+
return priority;
|
|
461
|
+
}
|
|
462
|
+
function specify(type, spec, index) {
|
|
463
|
+
var p = parseMediaType(type);
|
|
464
|
+
var s = 0;
|
|
465
|
+
if (!p) return null;
|
|
466
|
+
if (spec.type.toLowerCase() == p.type.toLowerCase()) s |= 4;
|
|
467
|
+
else if (spec.type != "*") return null;
|
|
468
|
+
if (spec.subtype.toLowerCase() == p.subtype.toLowerCase()) s |= 2;
|
|
469
|
+
else if (spec.subtype != "*") return null;
|
|
470
|
+
var keys = Object.keys(spec.params);
|
|
471
|
+
if (keys.length > 0) if (keys.every(function(k) {
|
|
472
|
+
return spec.params[k] == "*" || (spec.params[k] || "").toLowerCase() == (p.params[k] || "").toLowerCase();
|
|
473
|
+
})) s |= 1;
|
|
474
|
+
else return null;
|
|
475
|
+
return {
|
|
476
|
+
i: index,
|
|
477
|
+
o: spec.i,
|
|
478
|
+
q: spec.q,
|
|
479
|
+
s
|
|
480
|
+
};
|
|
481
|
+
}
|
|
482
|
+
function preferredMediaTypes$1(accept, provided) {
|
|
483
|
+
var accepts$1 = parseAccept(accept === void 0 ? "*/*" : accept || "");
|
|
484
|
+
if (!provided) return accepts$1.filter(isQuality).sort(compareSpecs).map(getFullType);
|
|
485
|
+
var priorities = provided.map(function getPriority(type, index) {
|
|
486
|
+
return getMediaTypePriority(type, accepts$1, index);
|
|
487
|
+
});
|
|
488
|
+
return priorities.filter(isQuality).sort(compareSpecs).map(function getType(priority) {
|
|
489
|
+
return provided[priorities.indexOf(priority)];
|
|
490
|
+
});
|
|
491
|
+
}
|
|
492
|
+
function compareSpecs(a, b) {
|
|
493
|
+
return b.q - a.q || b.s - a.s || a.o - b.o || a.i - b.i || 0;
|
|
494
|
+
}
|
|
495
|
+
function getFullType(spec) {
|
|
496
|
+
return spec.type + "/" + spec.subtype;
|
|
497
|
+
}
|
|
498
|
+
function isQuality(spec) {
|
|
499
|
+
return spec.q > 0;
|
|
500
|
+
}
|
|
501
|
+
function quoteCount(string$1) {
|
|
502
|
+
var count = 0;
|
|
503
|
+
var index = 0;
|
|
504
|
+
while ((index = string$1.indexOf("\"", index)) !== -1) {
|
|
505
|
+
count++;
|
|
506
|
+
index++;
|
|
507
|
+
}
|
|
508
|
+
return count;
|
|
509
|
+
}
|
|
510
|
+
function splitKeyValuePair(str) {
|
|
511
|
+
var index = str.indexOf("=");
|
|
512
|
+
var key;
|
|
513
|
+
var val;
|
|
514
|
+
if (index === -1) key = str;
|
|
515
|
+
else {
|
|
516
|
+
key = str.substr(0, index);
|
|
517
|
+
val = str.substr(index + 1);
|
|
518
|
+
}
|
|
519
|
+
return [key, val];
|
|
520
|
+
}
|
|
521
|
+
function splitMediaTypes(accept) {
|
|
522
|
+
var accepts$1 = accept.split(",");
|
|
523
|
+
for (var i = 1, j = 0; i < accepts$1.length; i++) if (quoteCount(accepts$1[j]) % 2 == 0) accepts$1[++j] = accepts$1[i];
|
|
524
|
+
else accepts$1[j] += "," + accepts$1[i];
|
|
525
|
+
accepts$1.length = j + 1;
|
|
526
|
+
return accepts$1;
|
|
527
|
+
}
|
|
528
|
+
function splitParameters(str) {
|
|
529
|
+
var parameters = str.split(";");
|
|
530
|
+
for (var i = 1, j = 0; i < parameters.length; i++) if (quoteCount(parameters[j]) % 2 == 0) parameters[++j] = parameters[i];
|
|
531
|
+
else parameters[j] += ";" + parameters[i];
|
|
532
|
+
parameters.length = j + 1;
|
|
533
|
+
for (var i = 0; i < parameters.length; i++) parameters[i] = parameters[i].trim();
|
|
534
|
+
return parameters;
|
|
535
|
+
}
|
|
536
|
+
}));
|
|
537
|
+
/*!
|
|
538
|
+
* negotiator
|
|
539
|
+
* Copyright(c) 2012 Federico Romero
|
|
540
|
+
* Copyright(c) 2012-2014 Isaac Z. Schlueter
|
|
541
|
+
* Copyright(c) 2015 Douglas Christopher Wilson
|
|
542
|
+
* MIT Licensed
|
|
543
|
+
*/
|
|
544
|
+
var require_negotiator = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
545
|
+
var preferredCharsets = require_charset();
|
|
546
|
+
var preferredEncodings = require_encoding();
|
|
547
|
+
var preferredLanguages = require_language();
|
|
548
|
+
var preferredMediaTypes = require_mediaType();
|
|
549
|
+
module.exports = Negotiator$1;
|
|
550
|
+
module.exports.Negotiator = Negotiator$1;
|
|
551
|
+
function Negotiator$1(request) {
|
|
552
|
+
if (!(this instanceof Negotiator$1)) return new Negotiator$1(request);
|
|
553
|
+
this.request = request;
|
|
554
|
+
}
|
|
555
|
+
Negotiator$1.prototype.charset = function charset(available) {
|
|
556
|
+
var set = this.charsets(available);
|
|
557
|
+
return set && set[0];
|
|
558
|
+
};
|
|
559
|
+
Negotiator$1.prototype.charsets = function charsets(available) {
|
|
560
|
+
return preferredCharsets(this.request.headers["accept-charset"], available);
|
|
561
|
+
};
|
|
562
|
+
Negotiator$1.prototype.encoding = function encoding(available) {
|
|
563
|
+
var set = this.encodings(available);
|
|
564
|
+
return set && set[0];
|
|
565
|
+
};
|
|
566
|
+
Negotiator$1.prototype.encodings = function encodings(available) {
|
|
567
|
+
return preferredEncodings(this.request.headers["accept-encoding"], available);
|
|
568
|
+
};
|
|
569
|
+
Negotiator$1.prototype.language = function language(available) {
|
|
570
|
+
var set = this.languages(available);
|
|
571
|
+
return set && set[0];
|
|
572
|
+
};
|
|
573
|
+
Negotiator$1.prototype.languages = function languages(available) {
|
|
574
|
+
return preferredLanguages(this.request.headers["accept-language"], available);
|
|
575
|
+
};
|
|
576
|
+
Negotiator$1.prototype.mediaType = function mediaType(available) {
|
|
577
|
+
var set = this.mediaTypes(available);
|
|
578
|
+
return set && set[0];
|
|
579
|
+
};
|
|
580
|
+
Negotiator$1.prototype.mediaTypes = function mediaTypes(available) {
|
|
581
|
+
return preferredMediaTypes(this.request.headers.accept, available);
|
|
582
|
+
};
|
|
583
|
+
Negotiator$1.prototype.preferredCharset = Negotiator$1.prototype.charset;
|
|
584
|
+
Negotiator$1.prototype.preferredCharsets = Negotiator$1.prototype.charsets;
|
|
585
|
+
Negotiator$1.prototype.preferredEncoding = Negotiator$1.prototype.encoding;
|
|
586
|
+
Negotiator$1.prototype.preferredEncodings = Negotiator$1.prototype.encodings;
|
|
587
|
+
Negotiator$1.prototype.preferredLanguage = Negotiator$1.prototype.language;
|
|
588
|
+
Negotiator$1.prototype.preferredLanguages = Negotiator$1.prototype.languages;
|
|
589
|
+
Negotiator$1.prototype.preferredMediaType = Negotiator$1.prototype.mediaType;
|
|
590
|
+
Negotiator$1.prototype.preferredMediaTypes = Negotiator$1.prototype.mediaTypes;
|
|
591
|
+
}));
|
|
592
|
+
/*!
|
|
593
|
+
* accepts
|
|
594
|
+
* Copyright(c) 2014 Jonathan Ong
|
|
595
|
+
* Copyright(c) 2015 Douglas Christopher Wilson
|
|
596
|
+
* MIT Licensed
|
|
597
|
+
*/
|
|
598
|
+
var require_accepts = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
599
|
+
var Negotiator = require_negotiator();
|
|
600
|
+
var mime$1 = __require("mime-types");
|
|
601
|
+
module.exports = Accepts;
|
|
602
|
+
function Accepts(req) {
|
|
603
|
+
if (!(this instanceof Accepts)) return new Accepts(req);
|
|
604
|
+
this.headers = req.headers;
|
|
605
|
+
this.negotiator = new Negotiator(req);
|
|
606
|
+
}
|
|
607
|
+
Accepts.prototype.type = Accepts.prototype.types = function(types_) {
|
|
608
|
+
var types = types_;
|
|
609
|
+
if (types && !Array.isArray(types)) {
|
|
610
|
+
types = new Array(arguments.length);
|
|
611
|
+
for (var i = 0; i < types.length; i++) types[i] = arguments[i];
|
|
612
|
+
}
|
|
613
|
+
if (!types || types.length === 0) return this.negotiator.mediaTypes();
|
|
614
|
+
if (!this.headers.accept) return types[0];
|
|
615
|
+
var mimes = types.map(extToMime);
|
|
616
|
+
var first = this.negotiator.mediaTypes(mimes.filter(validMime))[0];
|
|
617
|
+
return first ? types[mimes.indexOf(first)] : false;
|
|
618
|
+
};
|
|
619
|
+
Accepts.prototype.encoding = Accepts.prototype.encodings = function(encodings_) {
|
|
620
|
+
var encodings = encodings_;
|
|
621
|
+
if (encodings && !Array.isArray(encodings)) {
|
|
622
|
+
encodings = new Array(arguments.length);
|
|
623
|
+
for (var i = 0; i < encodings.length; i++) encodings[i] = arguments[i];
|
|
624
|
+
}
|
|
625
|
+
if (!encodings || encodings.length === 0) return this.negotiator.encodings();
|
|
626
|
+
return this.negotiator.encodings(encodings)[0] || false;
|
|
627
|
+
};
|
|
628
|
+
Accepts.prototype.charset = Accepts.prototype.charsets = function(charsets_) {
|
|
629
|
+
var charsets = charsets_;
|
|
630
|
+
if (charsets && !Array.isArray(charsets)) {
|
|
631
|
+
charsets = new Array(arguments.length);
|
|
632
|
+
for (var i = 0; i < charsets.length; i++) charsets[i] = arguments[i];
|
|
633
|
+
}
|
|
634
|
+
if (!charsets || charsets.length === 0) return this.negotiator.charsets();
|
|
635
|
+
return this.negotiator.charsets(charsets)[0] || false;
|
|
636
|
+
};
|
|
637
|
+
Accepts.prototype.lang = Accepts.prototype.langs = Accepts.prototype.language = Accepts.prototype.languages = function(languages_) {
|
|
638
|
+
var languages = languages_;
|
|
639
|
+
if (languages && !Array.isArray(languages)) {
|
|
640
|
+
languages = new Array(arguments.length);
|
|
641
|
+
for (var i = 0; i < languages.length; i++) languages[i] = arguments[i];
|
|
642
|
+
}
|
|
643
|
+
if (!languages || languages.length === 0) return this.negotiator.languages();
|
|
644
|
+
return this.negotiator.languages(languages)[0] || false;
|
|
645
|
+
};
|
|
646
|
+
function extToMime(type) {
|
|
647
|
+
return type.indexOf("/") === -1 ? mime$1.lookup(type) : type;
|
|
648
|
+
}
|
|
649
|
+
function validMime(type) {
|
|
650
|
+
return typeof type === "string";
|
|
651
|
+
}
|
|
652
|
+
}));
|
|
161
653
|
function pack$2(value) {
|
|
162
654
|
if (value === void 0 || value === null) return null;
|
|
163
655
|
return base64.urlEncode(new MessageBuilder().build(value));
|
|
@@ -170,7 +662,7 @@ function unpack$2(encodedValue) {
|
|
|
170
662
|
}
|
|
171
663
|
function pack$1(key, value, encryption) {
|
|
172
664
|
if (value === void 0 || value === null) return null;
|
|
173
|
-
return `s:${encryption.
|
|
665
|
+
return `s:${encryption.getMessageVerifier().sign(value, void 0, key)}`;
|
|
174
666
|
}
|
|
175
667
|
function canUnpack$1(signedValue) {
|
|
176
668
|
return typeof signedValue === "string" && signedValue.substring(0, 2) === "s:";
|
|
@@ -178,7 +670,7 @@ function canUnpack$1(signedValue) {
|
|
|
178
670
|
function unpack$1(key, signedValue, encryption) {
|
|
179
671
|
const value = signedValue.slice(2);
|
|
180
672
|
if (!value) return null;
|
|
181
|
-
return encryption.
|
|
673
|
+
return encryption.getMessageVerifier().unsign(value, key);
|
|
182
674
|
}
|
|
183
675
|
function pack(key, value, encryption) {
|
|
184
676
|
if (value === void 0 || value === null) return null;
|
|
@@ -269,6 +761,7 @@ var CookieParser = class {
|
|
|
269
761
|
return this.#cookies;
|
|
270
762
|
}
|
|
271
763
|
};
|
|
764
|
+
var import_accepts = /* @__PURE__ */ __toESM(require_accepts(), 1);
|
|
272
765
|
var HttpRequest = class extends Macroable {
|
|
273
766
|
#qsParser;
|
|
274
767
|
#encryption;
|
|
@@ -302,7 +795,7 @@ var HttpRequest = class extends Macroable {
|
|
|
302
795
|
if (!this.#cookieParser) this.#cookieParser = new CookieParser(this.header("cookie"), this.#encryption);
|
|
303
796
|
}
|
|
304
797
|
#initiateAccepts() {
|
|
305
|
-
this.#lazyAccepts = this.#lazyAccepts ||
|
|
798
|
+
this.#lazyAccepts = this.#lazyAccepts || (0, import_accepts.default)(this.request);
|
|
306
799
|
}
|
|
307
800
|
id() {
|
|
308
801
|
let requestId = this.header("x-request-id");
|
|
@@ -512,7 +1005,7 @@ var HttpRequest = class extends Macroable {
|
|
|
512
1005
|
hasValidSignature(purpose) {
|
|
513
1006
|
const { signature, ...rest } = this.qs();
|
|
514
1007
|
if (!signature) return false;
|
|
515
|
-
const signedUrl = this.#encryption.
|
|
1008
|
+
const signedUrl = this.#encryption.getMessageVerifier().unsign(signature, purpose);
|
|
516
1009
|
if (!signedUrl) return false;
|
|
517
1010
|
const queryString = this.#qsParser.stringify(rest);
|
|
518
1011
|
return queryString ? safeEqual(signedUrl, `${this.url()}?${queryString}`) : safeEqual(signedUrl, this.url());
|
package/build/factories/main.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import "../helpers-
|
|
2
|
-
import { _ as Qs, c as HttpRequest, i as HttpResponse, n as Server, r as HttpContext, s as Router, t as defineConfig } from "../define_config-
|
|
1
|
+
import "../helpers-oKG4uNSM.js";
|
|
2
|
+
import { _ as Qs, c as HttpRequest, i as HttpResponse, n as Server, r as HttpContext, s as Router, t as defineConfig } from "../define_config-Dh5SpqNg.js";
|
|
3
3
|
import "../helpers-C_2HouOe.js";
|
|
4
4
|
import "../url_builder-piNQy-CF.js";
|
|
5
5
|
import { Container } from "@adonisjs/fold";
|
|
@@ -7,7 +7,7 @@ import { Socket } from "node:net";
|
|
|
7
7
|
import proxyAddr from "proxy-addr";
|
|
8
8
|
import { safeStringify } from "@poppinss/utils/json";
|
|
9
9
|
import { AppFactory } from "@adonisjs/application/factories";
|
|
10
|
-
import { EncryptionFactory } from "@
|
|
10
|
+
import { EncryptionFactory } from "@boringnode/encryption/factories";
|
|
11
11
|
import { randomUUID } from "node:crypto";
|
|
12
12
|
import { IncomingMessage, ServerResponse } from "node:http";
|
|
13
13
|
import { Logger } from "@adonisjs/logger";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { Encryption } from '@
|
|
1
|
+
import type { Encryption } from '@boringnode/encryption';
|
|
2
2
|
import { IncomingMessage, ServerResponse } from 'node:http';
|
|
3
3
|
import { HttpRequest } from '../src/request.ts';
|
|
4
4
|
import { type RequestConfig } from '../src/types/request.ts';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { Encryption } from '@
|
|
1
|
+
import type { Encryption } from '@boringnode/encryption';
|
|
2
2
|
import { IncomingMessage, ServerResponse } from 'node:http';
|
|
3
3
|
import { HttpResponse } from '../src/response.ts';
|
|
4
4
|
import { type Router } from '../src/router/main.ts';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Logger } from '@adonisjs/logger';
|
|
2
2
|
import { Emitter } from '@adonisjs/events';
|
|
3
|
-
import type { Encryption } from '@
|
|
3
|
+
import type { Encryption } from '@boringnode/encryption';
|
|
4
4
|
import type { Application } from '@adonisjs/application';
|
|
5
5
|
import { Server } from '../src/server/main.ts';
|
|
6
6
|
import type { ServerConfig } from '../src/types/server.ts';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { t as createURL } from "./helpers-C_2HouOe.js";
|
|
2
|
-
import "node:module";
|
|
2
|
+
import { createRequire } from "node:module";
|
|
3
3
|
import { InvalidArgumentsException, RuntimeException } from "@poppinss/utils/exception";
|
|
4
4
|
import { debuglog } from "node:util";
|
|
5
5
|
import { serialize } from "cookie-es";
|
|
@@ -14,7 +14,13 @@ import diagnostics_channel from "node:diagnostics_channel";
|
|
|
14
14
|
import StringBuilder from "@poppinss/utils/string_builder";
|
|
15
15
|
import encodeUrl from "encodeurl";
|
|
16
16
|
import mime from "mime-types";
|
|
17
|
+
var __create = Object.create;
|
|
17
18
|
var __defProp = Object.defineProperty;
|
|
19
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
20
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
21
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
22
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
23
|
+
var __commonJSMin = (cb, mod) => () => (mod || cb((mod = { exports: {} }).exports, mod), mod.exports);
|
|
18
24
|
var __export = (all, symbols) => {
|
|
19
25
|
let target = {};
|
|
20
26
|
for (var name in all) __defProp(target, name, {
|
|
@@ -24,6 +30,21 @@ var __export = (all, symbols) => {
|
|
|
24
30
|
if (symbols) __defProp(target, Symbol.toStringTag, { value: "Module" });
|
|
25
31
|
return target;
|
|
26
32
|
};
|
|
33
|
+
var __copyProps = (to, from, except, desc) => {
|
|
34
|
+
if (from && typeof from === "object" || typeof from === "function") for (var keys = __getOwnPropNames(from), i = 0, n = keys.length, key; i < n; i++) {
|
|
35
|
+
key = keys[i];
|
|
36
|
+
if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
|
|
37
|
+
get: ((k) => from[k]).bind(null, key),
|
|
38
|
+
enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
|
|
39
|
+
});
|
|
40
|
+
}
|
|
41
|
+
return to;
|
|
42
|
+
};
|
|
43
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", {
|
|
44
|
+
value: mod,
|
|
45
|
+
enumerable: true
|
|
46
|
+
}) : target, mod));
|
|
47
|
+
var __require = /* @__PURE__ */ createRequire(import.meta.url);
|
|
27
48
|
var debug_default = debuglog("adonisjs:http");
|
|
28
49
|
function canWriteResponseBody(value, ctx) {
|
|
29
50
|
return value !== void 0 && !ctx.response.hasLazyBody && value !== ctx.response;
|
|
@@ -83,6 +104,7 @@ var Route = class extends Macroable {
|
|
|
83
104
|
const parts = handler.split(".");
|
|
84
105
|
const method = parts.length === 1 ? "handle" : parts.pop();
|
|
85
106
|
const moduleRefId = parts.join(".");
|
|
107
|
+
const controllerName = new StringBuilder(moduleRefId.split("/").pop()).removeSuffix("controller").snakeCase();
|
|
86
108
|
return {
|
|
87
109
|
handler: {
|
|
88
110
|
method,
|
|
@@ -91,21 +113,25 @@ var Route = class extends Macroable {
|
|
|
91
113
|
...moduleImporter(() => this.#app.import(moduleRefId), method).toHandleMethod(),
|
|
92
114
|
name: handler
|
|
93
115
|
},
|
|
94
|
-
routeName:
|
|
116
|
+
routeName: method === "handle" ? controllerName.toString() : `${controllerName}.${string.snakeCase(method)}`
|
|
95
117
|
};
|
|
96
118
|
}
|
|
97
119
|
if (Array.isArray(handler)) {
|
|
98
120
|
const controller = handler[0];
|
|
99
121
|
const method = handler[1] ?? "handle";
|
|
100
|
-
if (is.class(controller))
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
122
|
+
if (is.class(controller)) {
|
|
123
|
+
const controllerName$1 = new StringBuilder(controller.name).removeSuffix("controller").snakeCase();
|
|
124
|
+
return {
|
|
125
|
+
handler: {
|
|
126
|
+
method,
|
|
127
|
+
reference: handler,
|
|
128
|
+
importExpression: null,
|
|
129
|
+
...moduleCaller(controller, method).toHandleMethod()
|
|
130
|
+
},
|
|
131
|
+
routeName: method === "handle" ? controllerName$1.toString() : `${controllerName$1}.${string.snakeCase(method)}`
|
|
132
|
+
};
|
|
133
|
+
}
|
|
134
|
+
const controllerName = controller.name ? new StringBuilder(controller.name).removeSuffix("controller").snakeCase() : void 0;
|
|
109
135
|
return {
|
|
110
136
|
handler: {
|
|
111
137
|
method,
|
|
@@ -113,7 +139,7 @@ var Route = class extends Macroable {
|
|
|
113
139
|
importExpression: String(controller),
|
|
114
140
|
...moduleImporter(controller, method).toHandleMethod()
|
|
115
141
|
},
|
|
116
|
-
routeName:
|
|
142
|
+
routeName: controllerName ? method === "handle" ? controllerName.toString() : `${controllerName}.${string.snakeCase(method)}` : void 0
|
|
117
143
|
};
|
|
118
144
|
}
|
|
119
145
|
return { handler };
|
|
@@ -594,7 +620,7 @@ function parseRoute(pattern, matchers) {
|
|
|
594
620
|
return matchit.parse(pattern, matchers);
|
|
595
621
|
}
|
|
596
622
|
function createSignedURL(identifier, tokens, searchParamsStringifier, encryption, params, options) {
|
|
597
|
-
const signature = encryption.
|
|
623
|
+
const signature = encryption.getMessageVerifier().sign(createURL(identifier, tokens, searchParamsStringifier, params, {
|
|
598
624
|
...options,
|
|
599
625
|
prefixUrl: void 0
|
|
600
626
|
}), options?.expiresIn, options?.purpose);
|
|
@@ -657,4 +683,4 @@ function appendQueryString(uri, queryString, qsParser) {
|
|
|
657
683
|
const mergedQueryString = qsParser.stringify(Object.assign(qsParser.parse(query), queryString));
|
|
658
684
|
return mergedQueryString ? `${pathname}?${mergedQueryString}` : pathname;
|
|
659
685
|
}
|
|
660
|
-
export { canWriteResponseBody as C, tracing_channels_exports as S,
|
|
686
|
+
export { canWriteResponseBody as C, __require as D, __export as E, __toESM as O, tracing_channels_exports as S, __commonJSMin as T, Route as _, middlewareInfo as a, httpRequest as b, routeInfo as c, safeDecodeURI as d, toRoutesJSON as f, BriskRoute as g, RouteResource as h, matchRoute as i, serializeCookie as l, RouteGroup as m, createSignedURL as n, mime as o, trustProxy as p, encodeUrl as r, parseRoute as s, appendQueryString as t, parseRange as u, httpExceptionHandler as v, debug_default as w, httpResponseSerializer as x, httpMiddleware as y };
|
package/build/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { C as canWriteResponseBody, S as tracing_channels_exports, _ as Route, g as BriskRoute, h as RouteResource, m as RouteGroup, u as parseRange } from "./helpers-
|
|
2
|
-
import { _ as Qs, a as CookieSerializer, c as HttpRequest, d as Redirect, f as E_CANNOT_LOOKUP_ROUTE, g as errors_exports, h as E_ROUTE_NOT_FOUND, i as HttpResponse, l as CookieParser, m as E_HTTP_REQUEST_ABORTED, n as Server, o as ResponseStatus, p as E_HTTP_EXCEPTION, r as HttpContext, s as Router, t as defineConfig, u as CookieClient } from "./define_config-
|
|
1
|
+
import { C as canWriteResponseBody, S as tracing_channels_exports, _ as Route, g as BriskRoute, h as RouteResource, m as RouteGroup, u as parseRange } from "./helpers-oKG4uNSM.js";
|
|
2
|
+
import { _ as Qs, a as CookieSerializer, c as HttpRequest, d as Redirect, f as E_CANNOT_LOOKUP_ROUTE, g as errors_exports, h as E_ROUTE_NOT_FOUND, i as HttpResponse, l as CookieParser, m as E_HTTP_REQUEST_ABORTED, n as Server, o as ResponseStatus, p as E_HTTP_EXCEPTION, r as HttpContext, s as Router, t as defineConfig, u as CookieClient } from "./define_config-Dh5SpqNg.js";
|
|
3
3
|
import "./helpers-C_2HouOe.js";
|
|
4
4
|
import "./url_builder-piNQy-CF.js";
|
|
5
5
|
import Macroable from "@poppinss/macroable";
|
package/build/src/debug.d.ts
CHANGED
package/build/src/helpers.d.ts
CHANGED
package/build/src/helpers.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { a as middlewareInfo, c as routeInfo, i as matchRoute, l as serializeCookie, n as createSignedURL, o as mime, r as encodeUrl, s as parseRoute, t as appendQueryString } from "../helpers-
|
|
1
|
+
import { a as middlewareInfo, c as routeInfo, i as matchRoute, l as serializeCookie, n as createSignedURL, o as mime, r as encodeUrl, s as parseRoute, t as appendQueryString } from "../helpers-oKG4uNSM.js";
|
|
2
2
|
import { t as createURL } from "../helpers-C_2HouOe.js";
|
|
3
3
|
export { appendQueryString, createSignedURL, createURL, encodeUrl, matchRoute, middlewareInfo, mime, parseRoute, routeInfo, serializeCookie };
|
package/build/src/qs.d.ts
CHANGED
|
@@ -29,7 +29,7 @@ export declare class Qs {
|
|
|
29
29
|
* @param value - Query string to parse (e.g., "foo=bar&baz=qux")
|
|
30
30
|
* @returns Parsed object representation of the query string
|
|
31
31
|
*/
|
|
32
|
-
parse: (value: string) => import("qs").ParsedQs;
|
|
32
|
+
parse: (value: string) => import("@poppinss/qs").ParsedQs;
|
|
33
33
|
/**
|
|
34
34
|
* Converts a JavaScript object into a query string using the configured options
|
|
35
35
|
* @param value - Object to convert to query string
|
package/build/src/request.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import Macroable from '@poppinss/macroable';
|
|
2
|
-
import type { Encryption } from '@
|
|
2
|
+
import type { Encryption } from '@boringnode/encryption';
|
|
3
3
|
import { type ServerResponse, type IncomingMessage, type IncomingHttpHeaders } from 'node:http';
|
|
4
4
|
import type { Qs } from './qs.ts';
|
|
5
5
|
import { type RequestConfig } from './types/request.ts';
|
package/build/src/response.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import Macroable from '@poppinss/macroable';
|
|
2
|
-
import type { Encryption } from '@
|
|
2
|
+
import type { Encryption } from '@boringnode/encryption';
|
|
3
3
|
import { type ServerResponse, type IncomingMessage } from 'node:http';
|
|
4
4
|
import type { Qs } from './qs.ts';
|
|
5
5
|
import { Redirect } from './redirect.ts';
|
|
@@ -159,14 +159,14 @@ export declare class HttpResponse extends Macroable {
|
|
|
159
159
|
* @param key - Header name
|
|
160
160
|
* @returns The header value
|
|
161
161
|
*/
|
|
162
|
-
getHeader(key: string): import("http").OutgoingHttpHeader | undefined;
|
|
162
|
+
getHeader(key: string): import("node:http").OutgoingHttpHeader | undefined;
|
|
163
163
|
/**
|
|
164
164
|
* Gets all response headers as an object
|
|
165
165
|
*
|
|
166
166
|
* @returns Object containing all headers
|
|
167
167
|
*/
|
|
168
168
|
getHeaders(): {
|
|
169
|
-
[x: string]: import("http").OutgoingHttpHeader | undefined;
|
|
169
|
+
[x: string]: import("node:http").OutgoingHttpHeader | undefined;
|
|
170
170
|
accept?: string | string[] | undefined;
|
|
171
171
|
"accept-charset"?: string | string[] | undefined;
|
|
172
172
|
"accept-encoding"?: string | string[] | undefined;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { Encryption } from '@
|
|
1
|
+
import type { Encryption } from '@boringnode/encryption';
|
|
2
2
|
import type { Application } from '@adonisjs/application';
|
|
3
3
|
import type { Constructor, LazyImport } from '@poppinss/utils/types';
|
|
4
4
|
import type { Qs } from '../qs.ts';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { Logger } from '@adonisjs/logger';
|
|
2
2
|
import type { LazyImport } from '@poppinss/utils/types';
|
|
3
|
-
import type { Encryption } from '@
|
|
3
|
+
import type { Encryption } from '@boringnode/encryption';
|
|
4
4
|
import type { Server as HttpsServer } from 'node:https';
|
|
5
5
|
import type { Application } from '@adonisjs/application';
|
|
6
6
|
import type { EmitterLike } from '@adonisjs/events/types';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@adonisjs/http-server",
|
|
3
|
-
"version": "8.0.0-next.
|
|
3
|
+
"version": "8.0.0-next.15",
|
|
4
4
|
"description": "AdonisJS HTTP server with support packed with Routing and Cookies",
|
|
5
5
|
"main": "build/index.js",
|
|
6
6
|
"type": "module",
|
|
@@ -43,14 +43,14 @@
|
|
|
43
43
|
"author": "virk,adonisjs",
|
|
44
44
|
"license": "MIT",
|
|
45
45
|
"devDependencies": {
|
|
46
|
-
"@adonisjs/application": "^9.0.0-next.
|
|
47
|
-
"@adonisjs/encryption": "^7.0.0-next.1",
|
|
46
|
+
"@adonisjs/application": "^9.0.0-next.12",
|
|
48
47
|
"@adonisjs/eslint-config": "^3.0.0-next.1",
|
|
49
|
-
"@adonisjs/events": "^10.1.0-next.
|
|
50
|
-
"@adonisjs/fold": "^11.0.0-next.
|
|
51
|
-
"@adonisjs/logger": "^7.1.0-next.
|
|
48
|
+
"@adonisjs/events": "^10.1.0-next.3",
|
|
49
|
+
"@adonisjs/fold": "^11.0.0-next.3",
|
|
50
|
+
"@adonisjs/logger": "^7.1.0-next.3",
|
|
52
51
|
"@adonisjs/prettier-config": "^1.4.5",
|
|
53
52
|
"@adonisjs/tsconfig": "^2.0.0-next.0",
|
|
53
|
+
"@boringnode/encryption": "^0.2.2",
|
|
54
54
|
"@fastify/middie": "^9.0.3",
|
|
55
55
|
"@japa/assert": "^4.1.1",
|
|
56
56
|
"@japa/expect-type": "^2.0.3",
|
|
@@ -58,7 +58,7 @@
|
|
|
58
58
|
"@japa/runner": "^4.4.0",
|
|
59
59
|
"@japa/snapshot": "^2.0.9",
|
|
60
60
|
"@poppinss/ts-exec": "^1.4.1",
|
|
61
|
-
"@release-it/conventional-changelog": "^10.0.
|
|
61
|
+
"@release-it/conventional-changelog": "^10.0.3",
|
|
62
62
|
"@types/accepts": "^1.3.7",
|
|
63
63
|
"@types/content-disposition": "^0.5.9",
|
|
64
64
|
"@types/destroy": "^1.0.3",
|
|
@@ -67,15 +67,15 @@
|
|
|
67
67
|
"@types/fresh": "^0.5.3",
|
|
68
68
|
"@types/fs-extra": "^11.0.4",
|
|
69
69
|
"@types/mime-types": "^3.0.1",
|
|
70
|
-
"@types/node": "^
|
|
70
|
+
"@types/node": "^25.0.0",
|
|
71
71
|
"@types/on-finished": "^2.3.5",
|
|
72
72
|
"@types/pem": "^1.14.4",
|
|
73
73
|
"@types/proxy-addr": "^2.0.3",
|
|
74
|
-
"@types/qs": "^6.14.0",
|
|
75
74
|
"@types/supertest": "^6.0.3",
|
|
76
75
|
"@types/type-is": "^1.6.7",
|
|
77
76
|
"@types/vary": "^1.1.3",
|
|
78
|
-
"@vinejs/vine": "^4.
|
|
77
|
+
"@vinejs/vine": "^4.2.0",
|
|
78
|
+
"accepts": "^1.3.8",
|
|
79
79
|
"autocannon": "^8.0.0",
|
|
80
80
|
"c8": "^10.1.3",
|
|
81
81
|
"cross-env": "^10.1.0",
|
|
@@ -85,22 +85,22 @@
|
|
|
85
85
|
"get-port": "^7.1.0",
|
|
86
86
|
"http-status-codes": "^2.3.0",
|
|
87
87
|
"pem": "^1.14.8",
|
|
88
|
-
"prettier": "^3.7.
|
|
88
|
+
"prettier": "^3.7.4",
|
|
89
89
|
"reflect-metadata": "^0.2.2",
|
|
90
|
-
"release-it": "^19.0
|
|
90
|
+
"release-it": "^19.1.0",
|
|
91
91
|
"supertest": "^7.1.4",
|
|
92
|
-
"tsdown": "^0.17.
|
|
92
|
+
"tsdown": "^0.17.2",
|
|
93
93
|
"typedoc": "^0.28.15",
|
|
94
94
|
"typescript": "^5.9.3",
|
|
95
|
-
"youch": "^4.1.0-beta.
|
|
95
|
+
"youch": "^4.1.0-beta.13"
|
|
96
96
|
},
|
|
97
97
|
"dependencies": {
|
|
98
98
|
"@poppinss/macroable": "^1.1.0",
|
|
99
99
|
"@poppinss/matchit": "^3.2.0",
|
|
100
100
|
"@poppinss/middleware": "^3.2.6",
|
|
101
|
-
"@poppinss/
|
|
101
|
+
"@poppinss/qs": "^6.15.0",
|
|
102
|
+
"@poppinss/utils": "^7.0.0-next.4",
|
|
102
103
|
"@sindresorhus/is": "^7.1.1",
|
|
103
|
-
"accepts": "^1.3.8",
|
|
104
104
|
"content-disposition": "^1.0.1",
|
|
105
105
|
"cookie-es": "^2.0.0",
|
|
106
106
|
"destroy": "^1.2.0",
|
|
@@ -110,18 +110,17 @@
|
|
|
110
110
|
"mime-types": "^3.0.2",
|
|
111
111
|
"on-finished": "^2.4.1",
|
|
112
112
|
"proxy-addr": "^2.0.7",
|
|
113
|
-
"qs": "^6.14.0",
|
|
114
113
|
"tmp-cache": "^1.1.0",
|
|
115
114
|
"type-is": "^2.0.1",
|
|
116
115
|
"vary": "^1.1.2"
|
|
117
116
|
},
|
|
118
117
|
"peerDependencies": {
|
|
119
|
-
"@adonisjs/application": "^9.0.0-next.
|
|
120
|
-
"@adonisjs/
|
|
121
|
-
"@adonisjs/
|
|
122
|
-
"@adonisjs/
|
|
123
|
-
"@
|
|
124
|
-
"youch": "^4.1.0-beta.
|
|
118
|
+
"@adonisjs/application": "^9.0.0-next.12",
|
|
119
|
+
"@adonisjs/events": "^10.1.0-next.3",
|
|
120
|
+
"@adonisjs/fold": "^11.0.0-next.3",
|
|
121
|
+
"@adonisjs/logger": "^7.1.0-next.3",
|
|
122
|
+
"@boringnode/encryption": "^0.2.2",
|
|
123
|
+
"youch": "^4.1.0-beta.13"
|
|
125
124
|
},
|
|
126
125
|
"peerDependenciesMeta": {
|
|
127
126
|
"youch": {
|