coyotte508 commited on
Commit
eed224b
·
1 Parent(s): cd60ce3

⚗️ Try cookie settings

Browse files
Files changed (3) hide show
  1. package-lock.json +335 -1
  2. package.json +3 -1
  3. server.ts +18 -10
package-lock.json CHANGED
@@ -9,10 +9,12 @@
9
  "version": "1.0.0",
10
  "license": "ISC",
11
  "dependencies": {
12
- "koa": "^2.14.2"
 
13
  },
14
  "devDependencies": {
15
  "@types/koa": "^2.13.6",
 
16
  "ts-node": "^10.9.1"
17
  }
18
  },
@@ -28,6 +30,12 @@
28
  "node": ">=12"
29
  }
30
  },
 
 
 
 
 
 
31
  "node_modules/@jridgewell/resolve-uri": {
32
  "version": "3.1.1",
33
  "resolved": "https://registry.npmjs.org/@jridgewell/resolve-uri/-/resolve-uri-3.1.1.tgz",
@@ -181,6 +189,16 @@
181
  "@types/node": "*"
182
  }
183
  },
 
 
 
 
 
 
 
 
 
 
184
  "node_modules/@types/koa-compose": {
185
  "version": "3.2.5",
186
  "resolved": "https://registry.npmjs.org/@types/koa-compose/-/koa-compose-3.2.5.tgz",
@@ -273,6 +291,15 @@
273
  "integrity": "sha512-58S9QDqG0Xx27YwPSt9fJxivjYl432YCwfDMfZ+71RAqUrZef7LrKQZ3LHLOwCS4FLNBplP533Zx895SeOCHvA==",
274
  "dev": true
275
  },
 
 
 
 
 
 
 
 
 
276
  "node_modules/cache-content-type": {
277
  "version": "1.0.1",
278
  "resolved": "https://registry.npmjs.org/cache-content-type/-/cache-content-type-1.0.1.tgz",
@@ -285,6 +312,25 @@
285
  "node": ">= 6.0.0"
286
  }
287
  },
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
288
  "node_modules/co": {
289
  "version": "4.6.0",
290
  "resolved": "https://registry.npmjs.org/co/-/co-4.6.0.tgz",
@@ -294,6 +340,22 @@
294
  "node": ">= 0.12.0"
295
  }
296
  },
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
297
  "node_modules/content-disposition": {
298
  "version": "0.5.4",
299
  "resolved": "https://registry.npmjs.org/content-disposition/-/content-disposition-0.5.4.tgz",
@@ -325,6 +387,12 @@
325
  "node": ">= 0.8"
326
  }
327
  },
 
 
 
 
 
 
328
  "node_modules/create-require": {
329
  "version": "1.1.1",
330
  "resolved": "https://registry.npmjs.org/create-require/-/create-require-1.1.1.tgz",
@@ -352,6 +420,23 @@
352
  "resolved": "https://registry.npmjs.org/deep-equal/-/deep-equal-1.0.1.tgz",
353
  "integrity": "sha512-bHtC0iYvWhyaTzvV3CZgPeZQqCOBGyGsVV7v4eevpdkLHfiSrXUdBG+qAuSz4RI70sszvjQ1QSZ98An1yNwpSw=="
354
  },
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
355
  "node_modules/delegates": {
356
  "version": "1.0.0",
357
  "resolved": "https://registry.npmjs.org/delegates/-/delegates-1.0.0.tgz",
@@ -396,6 +481,27 @@
396
  "node": ">= 0.8"
397
  }
398
  },
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
399
  "node_modules/escape-html": {
400
  "version": "1.0.3",
401
  "resolved": "https://registry.npmjs.org/escape-html/-/escape-html-1.0.3.tgz",
@@ -409,6 +515,70 @@
409
  "node": ">= 0.6"
410
  }
411
  },
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
412
  "node_modules/has-symbols": {
413
  "version": "1.0.3",
414
  "resolved": "https://registry.npmjs.org/has-symbols/-/has-symbols-1.0.3.tgz",
@@ -434,6 +604,18 @@
434
  "url": "https://github.com/sponsors/ljharb"
435
  }
436
  },
 
 
 
 
 
 
 
 
 
 
 
 
437
  "node_modules/http-assert": {
438
  "version": "1.5.0",
439
  "resolved": "https://registry.npmjs.org/http-assert/-/http-assert-1.5.0.tgz",
@@ -469,6 +651,27 @@
469
  "node": ">= 0.6"
470
  }
471
  },
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
472
  "node_modules/inherits": {
473
  "version": "2.0.4",
474
  "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz",
@@ -532,6 +735,20 @@
532
  "node": "^4.8.4 || ^6.10.1 || ^7.10.1 || >= 8.1.4"
533
  }
534
  },
 
 
 
 
 
 
 
 
 
 
 
 
 
 
535
  "node_modules/koa-compose": {
536
  "version": "4.1.0",
537
  "resolved": "https://registry.npmjs.org/koa-compose/-/koa-compose-4.1.0.tgz",
@@ -595,6 +812,18 @@
595
  "node": ">= 0.6"
596
  }
597
  },
 
 
 
 
 
 
 
 
 
 
 
 
598
  "node_modules/on-finished": {
599
  "version": "2.4.1",
600
  "resolved": "https://registry.npmjs.org/on-finished/-/on-finished-2.4.1.tgz",
@@ -619,6 +848,61 @@
619
  "node": ">= 0.8"
620
  }
621
  },
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
622
  "node_modules/safe-buffer": {
623
  "version": "5.2.1",
624
  "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz",
@@ -638,11 +922,52 @@
638
  }
639
  ]
640
  },
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
641
  "node_modules/setprototypeof": {
642
  "version": "1.2.0",
643
  "resolved": "https://registry.npmjs.org/setprototypeof/-/setprototypeof-1.2.0.tgz",
644
  "integrity": "sha512-E5LDX7Wrp85Kil5bhZv46j8jOeboKq5JMmYM3gVGdGH8xFpPWXUMsNrlODCrkoxMEeNi/XZIwuRvY4XNwYMJpw=="
645
  },
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
646
  "node_modules/statuses": {
647
  "version": "1.5.0",
648
  "resolved": "https://registry.npmjs.org/statuses/-/statuses-1.5.0.tgz",
@@ -736,6 +1061,15 @@
736
  "node": ">=14.17"
737
  }
738
  },
 
 
 
 
 
 
 
 
 
739
  "node_modules/v8-compile-cache-lib": {
740
  "version": "3.0.1",
741
  "resolved": "https://registry.npmjs.org/v8-compile-cache-lib/-/v8-compile-cache-lib-3.0.1.tgz",
 
9
  "version": "1.0.0",
10
  "license": "ISC",
11
  "dependencies": {
12
+ "koa": "^2.14.2",
13
+ "koa-bodyparser": "^4.3.0"
14
  },
15
  "devDependencies": {
16
  "@types/koa": "^2.13.6",
17
+ "@types/koa-bodyparser": "^4.3.12",
18
  "ts-node": "^10.9.1"
19
  }
20
  },
 
30
  "node": ">=12"
31
  }
32
  },
33
+ "node_modules/@hapi/bourne": {
34
+ "version": "3.0.0",
35
+ "resolved": "https://registry.npmjs.org/@hapi/bourne/-/bourne-3.0.0.tgz",
36
+ "integrity": "sha512-Waj1cwPXJDucOib4a3bAISsKJVb15MKi9IvmTI/7ssVEm6sywXGjVJDhl6/umt1pK1ZS7PacXU3A1PmFKHEZ2w==",
37
+ "license": "BSD-3-Clause"
38
+ },
39
  "node_modules/@jridgewell/resolve-uri": {
40
  "version": "3.1.1",
41
  "resolved": "https://registry.npmjs.org/@jridgewell/resolve-uri/-/resolve-uri-3.1.1.tgz",
 
189
  "@types/node": "*"
190
  }
191
  },
192
+ "node_modules/@types/koa-bodyparser": {
193
+ "version": "4.3.12",
194
+ "resolved": "https://registry.npmjs.org/@types/koa-bodyparser/-/koa-bodyparser-4.3.12.tgz",
195
+ "integrity": "sha512-hKMmRMVP889gPIdLZmmtou/BijaU1tHPyMNmcK7FAHAdATnRcGQQy78EqTTxLH1D4FTsrxIzklAQCso9oGoebQ==",
196
+ "dev": true,
197
+ "license": "MIT",
198
+ "dependencies": {
199
+ "@types/koa": "*"
200
+ }
201
+ },
202
  "node_modules/@types/koa-compose": {
203
  "version": "3.2.5",
204
  "resolved": "https://registry.npmjs.org/@types/koa-compose/-/koa-compose-3.2.5.tgz",
 
291
  "integrity": "sha512-58S9QDqG0Xx27YwPSt9fJxivjYl432YCwfDMfZ+71RAqUrZef7LrKQZ3LHLOwCS4FLNBplP533Zx895SeOCHvA==",
292
  "dev": true
293
  },
294
+ "node_modules/bytes": {
295
+ "version": "3.1.2",
296
+ "resolved": "https://registry.npmjs.org/bytes/-/bytes-3.1.2.tgz",
297
+ "integrity": "sha512-/Nf7TyzTx6S3yRJObOAV7956r8cr2+Oj8AC5dt8wSP3BQAoeX58NoHyCU8P8zGkNXStjTSi6fzO6F0pBdcYbEg==",
298
+ "license": "MIT",
299
+ "engines": {
300
+ "node": ">= 0.8"
301
+ }
302
+ },
303
  "node_modules/cache-content-type": {
304
  "version": "1.0.1",
305
  "resolved": "https://registry.npmjs.org/cache-content-type/-/cache-content-type-1.0.1.tgz",
 
312
  "node": ">= 6.0.0"
313
  }
314
  },
315
+ "node_modules/call-bind": {
316
+ "version": "1.0.7",
317
+ "resolved": "https://registry.npmjs.org/call-bind/-/call-bind-1.0.7.tgz",
318
+ "integrity": "sha512-GHTSNSYICQ7scH7sZ+M2rFopRoLh8t2bLSW6BbgrtLsahOIB5iyAVJf9GjWK3cYTDaMj4XdBpM1cA6pIS0Kv2w==",
319
+ "license": "MIT",
320
+ "dependencies": {
321
+ "es-define-property": "^1.0.0",
322
+ "es-errors": "^1.3.0",
323
+ "function-bind": "^1.1.2",
324
+ "get-intrinsic": "^1.2.4",
325
+ "set-function-length": "^1.2.1"
326
+ },
327
+ "engines": {
328
+ "node": ">= 0.4"
329
+ },
330
+ "funding": {
331
+ "url": "https://github.com/sponsors/ljharb"
332
+ }
333
+ },
334
  "node_modules/co": {
335
  "version": "4.6.0",
336
  "resolved": "https://registry.npmjs.org/co/-/co-4.6.0.tgz",
 
340
  "node": ">= 0.12.0"
341
  }
342
  },
343
+ "node_modules/co-body": {
344
+ "version": "6.2.0",
345
+ "resolved": "https://registry.npmjs.org/co-body/-/co-body-6.2.0.tgz",
346
+ "integrity": "sha512-Kbpv2Yd1NdL1V/V4cwLVxraHDV6K8ayohr2rmH0J87Er8+zJjcTa6dAn9QMPC9CRgU8+aNajKbSf1TzDB1yKPA==",
347
+ "license": "MIT",
348
+ "dependencies": {
349
+ "@hapi/bourne": "^3.0.0",
350
+ "inflation": "^2.0.0",
351
+ "qs": "^6.5.2",
352
+ "raw-body": "^2.3.3",
353
+ "type-is": "^1.6.16"
354
+ },
355
+ "engines": {
356
+ "node": ">=8.0.0"
357
+ }
358
+ },
359
  "node_modules/content-disposition": {
360
  "version": "0.5.4",
361
  "resolved": "https://registry.npmjs.org/content-disposition/-/content-disposition-0.5.4.tgz",
 
387
  "node": ">= 0.8"
388
  }
389
  },
390
+ "node_modules/copy-to": {
391
+ "version": "2.0.1",
392
+ "resolved": "https://registry.npmjs.org/copy-to/-/copy-to-2.0.1.tgz",
393
+ "integrity": "sha512-3DdaFaU/Zf1AnpLiFDeNCD4TOWe3Zl2RZaTzUvWiIk5ERzcCodOE20Vqq4fzCbNoHURFHT4/us/Lfq+S2zyY4w==",
394
+ "license": "MIT"
395
+ },
396
  "node_modules/create-require": {
397
  "version": "1.1.1",
398
  "resolved": "https://registry.npmjs.org/create-require/-/create-require-1.1.1.tgz",
 
420
  "resolved": "https://registry.npmjs.org/deep-equal/-/deep-equal-1.0.1.tgz",
421
  "integrity": "sha512-bHtC0iYvWhyaTzvV3CZgPeZQqCOBGyGsVV7v4eevpdkLHfiSrXUdBG+qAuSz4RI70sszvjQ1QSZ98An1yNwpSw=="
422
  },
423
+ "node_modules/define-data-property": {
424
+ "version": "1.1.4",
425
+ "resolved": "https://registry.npmjs.org/define-data-property/-/define-data-property-1.1.4.tgz",
426
+ "integrity": "sha512-rBMvIzlpA8v6E+SJZoo++HAYqsLrkg7MSfIinMPFhmkorw7X+dOXVJQs+QT69zGkzMyfDnIMN2Wid1+NbL3T+A==",
427
+ "license": "MIT",
428
+ "dependencies": {
429
+ "es-define-property": "^1.0.0",
430
+ "es-errors": "^1.3.0",
431
+ "gopd": "^1.0.1"
432
+ },
433
+ "engines": {
434
+ "node": ">= 0.4"
435
+ },
436
+ "funding": {
437
+ "url": "https://github.com/sponsors/ljharb"
438
+ }
439
+ },
440
  "node_modules/delegates": {
441
  "version": "1.0.0",
442
  "resolved": "https://registry.npmjs.org/delegates/-/delegates-1.0.0.tgz",
 
481
  "node": ">= 0.8"
482
  }
483
  },
484
+ "node_modules/es-define-property": {
485
+ "version": "1.0.0",
486
+ "resolved": "https://registry.npmjs.org/es-define-property/-/es-define-property-1.0.0.tgz",
487
+ "integrity": "sha512-jxayLKShrEqqzJ0eumQbVhTYQM27CfT1T35+gCgDFoL82JLsXqTJ76zv6A0YLOgEnLUMvLzsDsGIrl8NFpT2gQ==",
488
+ "license": "MIT",
489
+ "dependencies": {
490
+ "get-intrinsic": "^1.2.4"
491
+ },
492
+ "engines": {
493
+ "node": ">= 0.4"
494
+ }
495
+ },
496
+ "node_modules/es-errors": {
497
+ "version": "1.3.0",
498
+ "resolved": "https://registry.npmjs.org/es-errors/-/es-errors-1.3.0.tgz",
499
+ "integrity": "sha512-Zf5H2Kxt2xjTvbJvP2ZWLEICxA6j+hAmMzIlypy4xcBg1vKVnx89Wy0GbS+kf5cwCVFFzdCFh2XSCFNULS6csw==",
500
+ "license": "MIT",
501
+ "engines": {
502
+ "node": ">= 0.4"
503
+ }
504
+ },
505
  "node_modules/escape-html": {
506
  "version": "1.0.3",
507
  "resolved": "https://registry.npmjs.org/escape-html/-/escape-html-1.0.3.tgz",
 
515
  "node": ">= 0.6"
516
  }
517
  },
518
+ "node_modules/function-bind": {
519
+ "version": "1.1.2",
520
+ "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.2.tgz",
521
+ "integrity": "sha512-7XHNxH7qX9xG5mIwxkhumTox/MIRNcOgDrxWsMt2pAr23WHp6MrRlN7FBSFpCpr+oVO0F744iUgR82nJMfG2SA==",
522
+ "license": "MIT",
523
+ "funding": {
524
+ "url": "https://github.com/sponsors/ljharb"
525
+ }
526
+ },
527
+ "node_modules/get-intrinsic": {
528
+ "version": "1.2.4",
529
+ "resolved": "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.2.4.tgz",
530
+ "integrity": "sha512-5uYhsJH8VJBTv7oslg4BznJYhDoRI6waYCxMmCdnTrcCrHA/fCFKoTFz2JKKE0HdDFUF7/oQuhzumXJK7paBRQ==",
531
+ "license": "MIT",
532
+ "dependencies": {
533
+ "es-errors": "^1.3.0",
534
+ "function-bind": "^1.1.2",
535
+ "has-proto": "^1.0.1",
536
+ "has-symbols": "^1.0.3",
537
+ "hasown": "^2.0.0"
538
+ },
539
+ "engines": {
540
+ "node": ">= 0.4"
541
+ },
542
+ "funding": {
543
+ "url": "https://github.com/sponsors/ljharb"
544
+ }
545
+ },
546
+ "node_modules/gopd": {
547
+ "version": "1.0.1",
548
+ "resolved": "https://registry.npmjs.org/gopd/-/gopd-1.0.1.tgz",
549
+ "integrity": "sha512-d65bNlIadxvpb/A2abVdlqKqV563juRnZ1Wtk6s1sIR8uNsXR70xqIzVqxVf1eTqDunwT2MkczEeaezCKTZhwA==",
550
+ "license": "MIT",
551
+ "dependencies": {
552
+ "get-intrinsic": "^1.1.3"
553
+ },
554
+ "funding": {
555
+ "url": "https://github.com/sponsors/ljharb"
556
+ }
557
+ },
558
+ "node_modules/has-property-descriptors": {
559
+ "version": "1.0.2",
560
+ "resolved": "https://registry.npmjs.org/has-property-descriptors/-/has-property-descriptors-1.0.2.tgz",
561
+ "integrity": "sha512-55JNKuIW+vq4Ke1BjOTjM2YctQIvCT7GFzHwmfZPGo5wnrgkid0YQtnAleFSqumZm4az3n2BS+erby5ipJdgrg==",
562
+ "license": "MIT",
563
+ "dependencies": {
564
+ "es-define-property": "^1.0.0"
565
+ },
566
+ "funding": {
567
+ "url": "https://github.com/sponsors/ljharb"
568
+ }
569
+ },
570
+ "node_modules/has-proto": {
571
+ "version": "1.0.3",
572
+ "resolved": "https://registry.npmjs.org/has-proto/-/has-proto-1.0.3.tgz",
573
+ "integrity": "sha512-SJ1amZAJUiZS+PhsVLf5tGydlaVB8EdFpaSO4gmiUKUOxk8qzn5AIy4ZeJUmh22znIdk/uMAUT2pl3FxzVUH+Q==",
574
+ "license": "MIT",
575
+ "engines": {
576
+ "node": ">= 0.4"
577
+ },
578
+ "funding": {
579
+ "url": "https://github.com/sponsors/ljharb"
580
+ }
581
+ },
582
  "node_modules/has-symbols": {
583
  "version": "1.0.3",
584
  "resolved": "https://registry.npmjs.org/has-symbols/-/has-symbols-1.0.3.tgz",
 
604
  "url": "https://github.com/sponsors/ljharb"
605
  }
606
  },
607
+ "node_modules/hasown": {
608
+ "version": "2.0.2",
609
+ "resolved": "https://registry.npmjs.org/hasown/-/hasown-2.0.2.tgz",
610
+ "integrity": "sha512-0hJU9SCPvmMzIBdZFqNPXWa6dqh7WdH0cII9y+CyS8rG3nL48Bclra9HmKhVVUHyPWNH5Y7xDwAB7bfgSjkUMQ==",
611
+ "license": "MIT",
612
+ "dependencies": {
613
+ "function-bind": "^1.1.2"
614
+ },
615
+ "engines": {
616
+ "node": ">= 0.4"
617
+ }
618
+ },
619
  "node_modules/http-assert": {
620
  "version": "1.5.0",
621
  "resolved": "https://registry.npmjs.org/http-assert/-/http-assert-1.5.0.tgz",
 
651
  "node": ">= 0.6"
652
  }
653
  },
654
+ "node_modules/iconv-lite": {
655
+ "version": "0.4.24",
656
+ "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.4.24.tgz",
657
+ "integrity": "sha512-v3MXnZAcvnywkTUEZomIActle7RXXeedOR31wwl7VlyoXO4Qi9arvSenNQWne1TcRwhCL1HwLI21bEqdpj8/rA==",
658
+ "license": "MIT",
659
+ "dependencies": {
660
+ "safer-buffer": ">= 2.1.2 < 3"
661
+ },
662
+ "engines": {
663
+ "node": ">=0.10.0"
664
+ }
665
+ },
666
+ "node_modules/inflation": {
667
+ "version": "2.1.0",
668
+ "resolved": "https://registry.npmjs.org/inflation/-/inflation-2.1.0.tgz",
669
+ "integrity": "sha512-t54PPJHG1Pp7VQvxyVCJ9mBbjG3Hqryges9bXoOO6GExCPa+//i/d5GSuFtpx3ALLd7lgIAur6zrIlBQyJuMlQ==",
670
+ "license": "MIT",
671
+ "engines": {
672
+ "node": ">= 0.8.0"
673
+ }
674
+ },
675
  "node_modules/inherits": {
676
  "version": "2.0.4",
677
  "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz",
 
735
  "node": "^4.8.4 || ^6.10.1 || ^7.10.1 || >= 8.1.4"
736
  }
737
  },
738
+ "node_modules/koa-bodyparser": {
739
+ "version": "4.4.1",
740
+ "resolved": "https://registry.npmjs.org/koa-bodyparser/-/koa-bodyparser-4.4.1.tgz",
741
+ "integrity": "sha512-kBH3IYPMb+iAXnrxIhXnW+gXV8OTzCu8VPDqvcDHW9SQrbkHmqPQtiZwrltNmSq6/lpipHnT7k7PsjlVD7kK0w==",
742
+ "license": "MIT",
743
+ "dependencies": {
744
+ "co-body": "^6.0.0",
745
+ "copy-to": "^2.0.1",
746
+ "type-is": "^1.6.18"
747
+ },
748
+ "engines": {
749
+ "node": ">=8.0.0"
750
+ }
751
+ },
752
  "node_modules/koa-compose": {
753
  "version": "4.1.0",
754
  "resolved": "https://registry.npmjs.org/koa-compose/-/koa-compose-4.1.0.tgz",
 
812
  "node": ">= 0.6"
813
  }
814
  },
815
+ "node_modules/object-inspect": {
816
+ "version": "1.13.3",
817
+ "resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.13.3.tgz",
818
+ "integrity": "sha512-kDCGIbxkDSXE3euJZZXzc6to7fCrKHNI/hSRQnRuQ+BWjFNzZwiFF8fj/6o2t2G9/jTj8PSIYTfCLelLZEeRpA==",
819
+ "license": "MIT",
820
+ "engines": {
821
+ "node": ">= 0.4"
822
+ },
823
+ "funding": {
824
+ "url": "https://github.com/sponsors/ljharb"
825
+ }
826
+ },
827
  "node_modules/on-finished": {
828
  "version": "2.4.1",
829
  "resolved": "https://registry.npmjs.org/on-finished/-/on-finished-2.4.1.tgz",
 
848
  "node": ">= 0.8"
849
  }
850
  },
851
+ "node_modules/qs": {
852
+ "version": "6.13.1",
853
+ "resolved": "https://registry.npmjs.org/qs/-/qs-6.13.1.tgz",
854
+ "integrity": "sha512-EJPeIn0CYrGu+hli1xilKAPXODtJ12T0sP63Ijx2/khC2JtuaN3JyNIpvmnkmaEtha9ocbG4A4cMcr+TvqvwQg==",
855
+ "license": "BSD-3-Clause",
856
+ "dependencies": {
857
+ "side-channel": "^1.0.6"
858
+ },
859
+ "engines": {
860
+ "node": ">=0.6"
861
+ },
862
+ "funding": {
863
+ "url": "https://github.com/sponsors/ljharb"
864
+ }
865
+ },
866
+ "node_modules/raw-body": {
867
+ "version": "2.5.2",
868
+ "resolved": "https://registry.npmjs.org/raw-body/-/raw-body-2.5.2.tgz",
869
+ "integrity": "sha512-8zGqypfENjCIqGhgXToC8aB2r7YrBX+AQAfIPs/Mlk+BtPTztOvTS01NRW/3Eh60J+a48lt8qsCzirQ6loCVfA==",
870
+ "license": "MIT",
871
+ "dependencies": {
872
+ "bytes": "3.1.2",
873
+ "http-errors": "2.0.0",
874
+ "iconv-lite": "0.4.24",
875
+ "unpipe": "1.0.0"
876
+ },
877
+ "engines": {
878
+ "node": ">= 0.8"
879
+ }
880
+ },
881
+ "node_modules/raw-body/node_modules/http-errors": {
882
+ "version": "2.0.0",
883
+ "resolved": "https://registry.npmjs.org/http-errors/-/http-errors-2.0.0.tgz",
884
+ "integrity": "sha512-FtwrG/euBzaEjYeRqOgly7G0qviiXoJWnvEH2Z1plBdXgbyjv34pHTSb9zoeHMyDy33+DWy5Wt9Wo+TURtOYSQ==",
885
+ "license": "MIT",
886
+ "dependencies": {
887
+ "depd": "2.0.0",
888
+ "inherits": "2.0.4",
889
+ "setprototypeof": "1.2.0",
890
+ "statuses": "2.0.1",
891
+ "toidentifier": "1.0.1"
892
+ },
893
+ "engines": {
894
+ "node": ">= 0.8"
895
+ }
896
+ },
897
+ "node_modules/raw-body/node_modules/statuses": {
898
+ "version": "2.0.1",
899
+ "resolved": "https://registry.npmjs.org/statuses/-/statuses-2.0.1.tgz",
900
+ "integrity": "sha512-RwNA9Z/7PrK06rYLIzFMlaF+l73iwpzsqRIFgbMLbTcLD6cOao82TaWefPXQvB2fOC4AjuYSEndS7N/mTCbkdQ==",
901
+ "license": "MIT",
902
+ "engines": {
903
+ "node": ">= 0.8"
904
+ }
905
+ },
906
  "node_modules/safe-buffer": {
907
  "version": "5.2.1",
908
  "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz",
 
922
  }
923
  ]
924
  },
925
+ "node_modules/safer-buffer": {
926
+ "version": "2.1.2",
927
+ "resolved": "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz",
928
+ "integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==",
929
+ "license": "MIT"
930
+ },
931
+ "node_modules/set-function-length": {
932
+ "version": "1.2.2",
933
+ "resolved": "https://registry.npmjs.org/set-function-length/-/set-function-length-1.2.2.tgz",
934
+ "integrity": "sha512-pgRc4hJ4/sNjWCSS9AmnS40x3bNMDTknHgL5UaMBTMyJnU90EgWh1Rz+MC9eFu4BuN/UwZjKQuY/1v3rM7HMfg==",
935
+ "license": "MIT",
936
+ "dependencies": {
937
+ "define-data-property": "^1.1.4",
938
+ "es-errors": "^1.3.0",
939
+ "function-bind": "^1.1.2",
940
+ "get-intrinsic": "^1.2.4",
941
+ "gopd": "^1.0.1",
942
+ "has-property-descriptors": "^1.0.2"
943
+ },
944
+ "engines": {
945
+ "node": ">= 0.4"
946
+ }
947
+ },
948
  "node_modules/setprototypeof": {
949
  "version": "1.2.0",
950
  "resolved": "https://registry.npmjs.org/setprototypeof/-/setprototypeof-1.2.0.tgz",
951
  "integrity": "sha512-E5LDX7Wrp85Kil5bhZv46j8jOeboKq5JMmYM3gVGdGH8xFpPWXUMsNrlODCrkoxMEeNi/XZIwuRvY4XNwYMJpw=="
952
  },
953
+ "node_modules/side-channel": {
954
+ "version": "1.0.6",
955
+ "resolved": "https://registry.npmjs.org/side-channel/-/side-channel-1.0.6.tgz",
956
+ "integrity": "sha512-fDW/EZ6Q9RiO8eFG8Hj+7u/oW+XrPTIChwCOM2+th2A6OblDtYYIpve9m+KvI9Z4C9qSEXlaGR6bTEYHReuglA==",
957
+ "license": "MIT",
958
+ "dependencies": {
959
+ "call-bind": "^1.0.7",
960
+ "es-errors": "^1.3.0",
961
+ "get-intrinsic": "^1.2.4",
962
+ "object-inspect": "^1.13.1"
963
+ },
964
+ "engines": {
965
+ "node": ">= 0.4"
966
+ },
967
+ "funding": {
968
+ "url": "https://github.com/sponsors/ljharb"
969
+ }
970
+ },
971
  "node_modules/statuses": {
972
  "version": "1.5.0",
973
  "resolved": "https://registry.npmjs.org/statuses/-/statuses-1.5.0.tgz",
 
1061
  "node": ">=14.17"
1062
  }
1063
  },
1064
+ "node_modules/unpipe": {
1065
+ "version": "1.0.0",
1066
+ "resolved": "https://registry.npmjs.org/unpipe/-/unpipe-1.0.0.tgz",
1067
+ "integrity": "sha512-pjy2bYhSsufwWlKwPc+l3cN7+wuJlK6uz0YdJEOlQDbl6jo/YlPi4mb8agUkVC8BF7V8NuzeyPNqRksA3hztKQ==",
1068
+ "license": "MIT",
1069
+ "engines": {
1070
+ "node": ">= 0.8"
1071
+ }
1072
+ },
1073
  "node_modules/v8-compile-cache-lib": {
1074
  "version": "3.0.1",
1075
  "resolved": "https://registry.npmjs.org/v8-compile-cache-lib/-/v8-compile-cache-lib-3.0.1.tgz",
package.json CHANGED
@@ -11,9 +11,11 @@
11
  "license": "ISC",
12
  "devDependencies": {
13
  "@types/koa": "^2.13.6",
 
14
  "ts-node": "^10.9.1"
15
  },
16
  "dependencies": {
17
- "koa": "^2.14.2"
 
18
  }
19
  }
 
11
  "license": "ISC",
12
  "devDependencies": {
13
  "@types/koa": "^2.13.6",
14
+ "@types/koa-bodyparser": "^4.3.12",
15
  "ts-node": "^10.9.1"
16
  },
17
  "dependencies": {
18
+ "koa": "^2.14.2",
19
+ "koa-bodyparser": "^4.3.0"
20
  }
21
  }
server.ts CHANGED
@@ -1,20 +1,28 @@
1
  import Koa from "koa";
 
2
 
3
  const app = new Koa();
4
 
5
- let headers;
6
 
7
  app.use(async (ctx) => {
8
- if (ctx.request.url.startsWith("/img/")) {
9
- ctx.body = "no image";
10
- headers = Object.fromEntries(Object.entries(ctx.request.headers));
11
- return;
 
 
 
 
 
 
 
 
 
 
 
 
12
  }
13
-
14
- console.log(ctx.request.url, ctx.request.method);
15
- ctx.body = {
16
- headers,
17
- };
18
  });
19
 
20
  app.listen(7860);
 
1
  import Koa from "koa";
2
+ import bodyParser from "koa-bodyparser";
3
 
4
  const app = new Koa();
5
 
6
+ app.use(bodyParser());
7
 
8
  app.use(async (ctx) => {
9
+ if (ctx.request.method === "POST") {
10
+ const { cookie } = ctx.request.body as { cookie: string };
11
+ ctx.cookies.set("cookie", cookie);
12
+ ctx.redirect( "/");
13
+ } else {
14
+ ctx.body = `<html>
15
+ <body>
16
+ <pre>${JSON.stringify(Object.fromEntries(Object.entries(ctx.request.headers)), null, 2)}</pre>
17
+ <form method="POST">
18
+ <label>Cookie value<br>
19
+ <input type="text" name="cookie />
20
+ </label>
21
+ <button>Send</button>
22
+ </form>
23
+ </body>
24
+ </html>`;
25
  }
 
 
 
 
 
26
  });
27
 
28
  app.listen(7860);