wreq 1.2.6 → 1.2.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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 87d989f8582c97e03c95ef1fd90d1f089eb35c787da5d9527942548483c1dd55
4
- data.tar.gz: 413a4656384561df504e9b6a175c2f82c3373693df41bb88cc2ba78c2d319cb4
3
+ metadata.gz: d852c54ebc9e5ea5e94dee83399d2d59f8df824cc68bc74065e94eb0885e99a6
4
+ data.tar.gz: def648deb12f7339b3de1271dee582cb9e9c03f9cf6cf483bc8031f3815861b5
5
5
  SHA512:
6
- metadata.gz: 2c0b23be854a1bdf4421ec7e32118a41e3c209bded0a32cde470614bf487fdaf48082ad432913a597ef176d14b12eeabcf976ccbddf49d99446ed3f08b5e3710
7
- data.tar.gz: 53190348795c05829f6119753c6402a6c64a662a72c37ab88616275bbfce47292577348c8f53665d7abf8004d626ded649ff7b7d31d31f99fbc87e7caddef8e7
6
+ metadata.gz: f25d1ee505f44c8ce4c81b8f12f91a87d7ec6b5c324aa1c2478a6d9a2e18e4604036f46bd9cf711b951007ae53cb6811dd0b7e77973631d179dfd070f2c240ce
7
+ data.tar.gz: 890f1c4514804666a60f40735d9a678c26edbf0c2d17d057990e61d3209e39aca819c2ebf26cff8e4a3f1a2f7661b94467f109d24f469c3e93007f6c5bcdbf7a
@@ -0,0 +1,4 @@
1
+ # Rake creates or removes this host-specific file when switching platforms.
2
+ include = [
3
+ { path = "windows.toml", optional = true },
4
+ ]
data/Cargo.lock CHANGED
@@ -80,14 +80,14 @@ dependencies = [
80
80
  "regex",
81
81
  "rustc-hash",
82
82
  "shlex 1.3.0",
83
- "syn",
83
+ "syn 2.0.119",
84
84
  ]
85
85
 
86
86
  [[package]]
87
87
  name = "bitflags"
88
- version = "2.13.0"
88
+ version = "2.13.1"
89
89
  source = "registry+https://github.com/rust-lang/crates.io-index"
90
- checksum = "b4388bee8683e3d04af747c73422af53102d2bd24d9eadb6cbc100baef4b43f8"
90
+ checksum = "b588b76d00fde79687d7646a9b5bdf3cc0f655e0bbd080335a95d7e96f3587da"
91
91
 
92
92
  [[package]]
93
93
  name = "brotli"
@@ -113,7 +113,7 @@ dependencies = [
113
113
  [[package]]
114
114
  name = "btls"
115
115
  version = "0.5.6"
116
- source = "git+https://github.com/0x676e67/btls?branch=demo%2Fmerge-upstream-boring-20260616#397dfae69044c0c19ba3028e8b25f8481fbc0f00"
116
+ source = "git+https://github.com/0x676e67/btls?branch=demo%2Fmerge-upstream-boring-20260616#3100f47f98d45765a55ce0b9f8d3a281109cb6fe"
117
117
  dependencies = [
118
118
  "bitflags",
119
119
  "btls-sys",
@@ -125,7 +125,7 @@ dependencies = [
125
125
  [[package]]
126
126
  name = "btls-sys"
127
127
  version = "0.5.6"
128
- source = "git+https://github.com/0x676e67/btls?branch=demo%2Fmerge-upstream-boring-20260616#397dfae69044c0c19ba3028e8b25f8481fbc0f00"
128
+ source = "git+https://github.com/0x676e67/btls?branch=demo%2Fmerge-upstream-boring-20260616#3100f47f98d45765a55ce0b9f8d3a281109cb6fe"
129
129
  dependencies = [
130
130
  "bindgen",
131
131
  "cmake",
@@ -141,9 +141,9 @@ checksum = "fc652a48c352aef3ea3aed32080501cf3ef6ed5da78602a020c991775b0aff04"
141
141
 
142
142
  [[package]]
143
143
  name = "cc"
144
- version = "1.2.66"
144
+ version = "1.4.0"
145
145
  source = "registry+https://github.com/rust-lang/crates.io-index"
146
- checksum = "f5d6cac793997bd970000024b2934968efe83b382de4fdcf4fcb46b6ee4ad996"
146
+ checksum = "5add81bb678e6cb321aff7fa0dc7689ad82b112dbc032cea19f91d6b8e3582b9"
147
147
  dependencies = [
148
148
  "find-msvc-tools",
149
149
  "jobserver",
@@ -246,9 +246,6 @@ name = "deranged"
246
246
  version = "0.5.8"
247
247
  source = "registry+https://github.com/rust-lang/crates.io-index"
248
248
  checksum = "7cd812cc2bc1d69d4764bd80df88b4317eaef9e773c75226407d9bc0876b211c"
249
- dependencies = [
250
- "powerfmt",
251
- ]
252
249
 
253
250
  [[package]]
254
251
  name = "displaydoc"
@@ -258,7 +255,7 @@ checksum = "1ac70aa55017e108007fbaf5aa0f54b021c98f92ff8af59d42eda9da96e3dd4f"
258
255
  dependencies = [
259
256
  "proc-macro2",
260
257
  "quote",
261
- "syn",
258
+ "syn 2.0.119",
262
259
  ]
263
260
 
264
261
  [[package]]
@@ -332,13 +329,13 @@ dependencies = [
332
329
 
333
330
  [[package]]
334
331
  name = "foreign-types-macros"
335
- version = "0.2.3"
332
+ version = "0.2.4"
336
333
  source = "registry+https://github.com/rust-lang/crates.io-index"
337
- checksum = "1a5c6c585bc94aaf2c7b51dd4c2ba22680844aba4c687be581871a6f518c5742"
334
+ checksum = "ea5190182e6915eb873ddbc16e23b711b6eb1f9c00a0d0a3a91b5f6228475225"
338
335
  dependencies = [
339
336
  "proc-macro2",
340
337
  "quote",
341
- "syn",
338
+ "syn 3.0.3",
342
339
  ]
343
340
 
344
341
  [[package]]
@@ -374,36 +371,36 @@ dependencies = [
374
371
 
375
372
  [[package]]
376
373
  name = "futures-channel"
377
- version = "0.3.32"
374
+ version = "0.3.33"
378
375
  source = "registry+https://github.com/rust-lang/crates.io-index"
379
- checksum = "07bbe89c50d7a535e539b8c17bc0b49bdb77747034daa8087407d655f3f7cc1d"
376
+ checksum = "262590f4fe6afeb0bc83be1daa64e52657fe185690a958af7f3ad0e92085c5ae"
380
377
  dependencies = [
381
378
  "futures-core",
382
379
  ]
383
380
 
384
381
  [[package]]
385
382
  name = "futures-core"
386
- version = "0.3.32"
383
+ version = "0.3.33"
387
384
  source = "registry+https://github.com/rust-lang/crates.io-index"
388
- checksum = "7e3450815272ef58cec6d564423f6e755e25379b217b0bc688e295ba24df6b1d"
385
+ checksum = "2cd50c473c80f6d7c3670a752354b8e569b1a7cbfdc0419ec88e5edad85e0dc7"
389
386
 
390
387
  [[package]]
391
388
  name = "futures-sink"
392
- version = "0.3.32"
389
+ version = "0.3.33"
393
390
  source = "registry+https://github.com/rust-lang/crates.io-index"
394
- checksum = "c39754e157331b013978ec91992bde1ac089843443c49cbc7f46150b0fad0893"
391
+ checksum = "e34418ac499d6305c2fb5ad0ed2f6ac998c5f8ca209b4510f7f94242c647e307"
395
392
 
396
393
  [[package]]
397
394
  name = "futures-task"
398
- version = "0.3.32"
395
+ version = "0.3.33"
399
396
  source = "registry+https://github.com/rust-lang/crates.io-index"
400
- checksum = "037711b3d59c33004d3856fbdc83b99d4ff37a24768fa1be9ce3538a1cde4393"
397
+ checksum = "b231ed28831efb4a61a08580c4bc233ec56bc009f4cd8f52da2c3cb97df0c109"
401
398
 
402
399
  [[package]]
403
400
  name = "futures-util"
404
- version = "0.3.32"
401
+ version = "0.3.33"
405
402
  source = "registry+https://github.com/rust-lang/crates.io-index"
406
- checksum = "389ca41296e6190b48053de0321d02a77f32f8a5d2461dd38762c0593805c6d6"
403
+ checksum = "a77a90a256fce34da66415271e30f94ee91c57b04b8a2c042d9cf3220179deaa"
407
404
  dependencies = [
408
405
  "futures-core",
409
406
  "futures-task",
@@ -424,9 +421,9 @@ dependencies = [
424
421
 
425
422
  [[package]]
426
423
  name = "glob"
427
- version = "0.3.3"
424
+ version = "0.3.4"
428
425
  source = "registry+https://github.com/rust-lang/crates.io-index"
429
- checksum = "0cc23270f6e1808e30a928bdc84dea0b9b4136a8bc82338574f23baf47bbd280"
426
+ checksum = "e4eba85ea1d0a966a983acd07deee566e67395d2d96b6fb39e62b5a833f1eb0b"
430
427
 
431
428
  [[package]]
432
429
  name = "hashbrown"
@@ -451,9 +448,9 @@ dependencies = [
451
448
 
452
449
  [[package]]
453
450
  name = "http-body"
454
- version = "1.0.1"
451
+ version = "1.1.0"
455
452
  source = "registry+https://github.com/rust-lang/crates.io-index"
456
- checksum = "1efedce1fb8e6913f23e0c92de8e62cd5b772a67e7b3946df930a62566c93184"
453
+ checksum = "ca2a8f2913ee65f60facd6a5905613afaa448497a0230cc41ce022d93290bc2c"
457
454
  dependencies = [
458
455
  "bytes",
459
456
  "http",
@@ -461,9 +458,9 @@ dependencies = [
461
458
 
462
459
  [[package]]
463
460
  name = "http-body-util"
464
- version = "0.1.3"
461
+ version = "0.1.4"
465
462
  source = "registry+https://github.com/rust-lang/crates.io-index"
466
- checksum = "b021d93e26becf5dc7e1b75b1bed1fd93124b374ceb73f43d4d4eafec896a64a"
463
+ checksum = "e9f41fd6a08e4d4ec69df65976da761afd5ad5e58a9d4acb46bd1c953a9e3ff2"
467
464
  dependencies = [
468
465
  "bytes",
469
466
  "futures-core",
@@ -499,12 +496,13 @@ checksum = "6dbf3de79e51f3d586ab4cb9d5c3e2c14aa28ed23d180cf89b4df0454a69cc87"
499
496
 
500
497
  [[package]]
501
498
  name = "icu_collections"
502
- version = "2.1.1"
499
+ version = "2.2.0"
503
500
  source = "registry+https://github.com/rust-lang/crates.io-index"
504
- checksum = "4c6b649701667bbe825c3b7e6388cb521c23d88644678e83c0c4d0a621a34b43"
501
+ checksum = "2984d1cd16c883d7935b9e07e44071dca8d917fd52ecc02c04d5fa0b5a3f191c"
505
502
  dependencies = [
506
503
  "displaydoc",
507
504
  "potential_utf",
505
+ "utf8_iter",
508
506
  "yoke",
509
507
  "zerofrom",
510
508
  "zerovec",
@@ -512,9 +510,9 @@ dependencies = [
512
510
 
513
511
  [[package]]
514
512
  name = "icu_locale_core"
515
- version = "2.1.1"
513
+ version = "2.2.0"
516
514
  source = "registry+https://github.com/rust-lang/crates.io-index"
517
- checksum = "edba7861004dd3714265b4db54a3c390e880ab658fec5f7db895fae2046b5bb6"
515
+ checksum = "92219b62b3e2b4d88ac5119f8904c10f8f61bf7e95b640d25ba3075e6cac2c29"
518
516
  dependencies = [
519
517
  "displaydoc",
520
518
  "litemap",
@@ -525,9 +523,9 @@ dependencies = [
525
523
 
526
524
  [[package]]
527
525
  name = "icu_normalizer"
528
- version = "2.1.1"
526
+ version = "2.2.0"
529
527
  source = "registry+https://github.com/rust-lang/crates.io-index"
530
- checksum = "5f6c8828b67bf8908d82127b2054ea1b4427ff0230ee9141c54251934ab1b599"
528
+ checksum = "c56e5ee99d6e3d33bd91c5d85458b6005a22140021cc324cea84dd0e72cff3b4"
531
529
  dependencies = [
532
530
  "icu_collections",
533
531
  "icu_normalizer_data",
@@ -539,15 +537,15 @@ dependencies = [
539
537
 
540
538
  [[package]]
541
539
  name = "icu_normalizer_data"
542
- version = "2.1.1"
540
+ version = "2.2.0"
543
541
  source = "registry+https://github.com/rust-lang/crates.io-index"
544
- checksum = "7aedcccd01fc5fe81e6b489c15b247b8b0690feb23304303a9e560f37efc560a"
542
+ checksum = "da3be0ae77ea334f4da67c12f149704f19f81d1adf7c51cf482943e84a2bad38"
545
543
 
546
544
  [[package]]
547
545
  name = "icu_properties"
548
- version = "2.1.2"
546
+ version = "2.2.0"
549
547
  source = "registry+https://github.com/rust-lang/crates.io-index"
550
- checksum = "020bfc02fe870ec3a66d93e677ccca0562506e5872c650f893269e08615d74ec"
548
+ checksum = "bee3b67d0ea5c2cca5003417989af8996f8604e34fb9ddf96208a033901e70de"
551
549
  dependencies = [
552
550
  "icu_collections",
553
551
  "icu_locale_core",
@@ -559,15 +557,15 @@ dependencies = [
559
557
 
560
558
  [[package]]
561
559
  name = "icu_properties_data"
562
- version = "2.1.2"
560
+ version = "2.2.0"
563
561
  source = "registry+https://github.com/rust-lang/crates.io-index"
564
- checksum = "616c294cf8d725c6afcd8f55abc17c56464ef6211f9ed59cccffe534129c77af"
562
+ checksum = "8e2bbb201e0c04f7b4b3e14382af113e17ba4f63e2c9d2ee626b720cbce54a14"
565
563
 
566
564
  [[package]]
567
565
  name = "icu_provider"
568
- version = "2.1.1"
566
+ version = "2.2.0"
569
567
  source = "registry+https://github.com/rust-lang/crates.io-index"
570
- checksum = "85962cf0ce02e1e0a629cc34e7ca3e373ce20dda4c4d7294bbd0bf1fdb59e614"
568
+ checksum = "139c4cf31c8b5f33d7e199446eff9c1e02decfc2f0eec2c8d71f65befa45b421"
571
569
  dependencies = [
572
570
  "displaydoc",
573
571
  "icu_locale_core",
@@ -591,9 +589,9 @@ dependencies = [
591
589
 
592
590
  [[package]]
593
591
  name = "idna_adapter"
594
- version = "1.2.1"
592
+ version = "1.2.2"
595
593
  source = "registry+https://github.com/rust-lang/crates.io-index"
596
- checksum = "3acae9609540aa318d1bc588455225fb2085b9ed0c4f6bd0d9d5bcd86f1a0344"
594
+ checksum = "cb68373c0d6620ef8105e855e7745e18b0d00d3bdb07fb532e434244cdb9a714"
597
595
  dependencies = [
598
596
  "icu_normalizer",
599
597
  "icu_properties",
@@ -650,9 +648,9 @@ checksum = "bbd2bcb4c963f2ddae06a2efc7e9f3591312473c50c6685e1f298068316e66fe"
650
648
 
651
649
  [[package]]
652
650
  name = "libc"
653
- version = "0.2.186"
651
+ version = "0.2.189"
654
652
  source = "registry+https://github.com/rust-lang/crates.io-index"
655
- checksum = "68ab91017fe16c622486840e4c83c9a37afeff978bd239b5293d61ece587de66"
653
+ checksum = "3eaf3ede3fee6db1a4c2ee091bf8a8b4dccdc6d17f656fb07896ee72867612f2"
656
654
 
657
655
  [[package]]
658
656
  name = "libloading"
@@ -681,9 +679,9 @@ dependencies = [
681
679
 
682
680
  [[package]]
683
681
  name = "lru"
684
- version = "0.18.0"
682
+ version = "0.18.1"
685
683
  source = "registry+https://github.com/rust-lang/crates.io-index"
686
- checksum = "8a860605968fce16869fd239cf4237a82f3ac470723415db603b0e8b6c8d4fb9"
684
+ checksum = "0b6180140927ee907000b0aa540091f6ea512ead4447c92b8fc35bc72788a5a6"
687
685
  dependencies = [
688
686
  "hashbrown",
689
687
  ]
@@ -709,7 +707,7 @@ checksum = "47607461fd8e1513cb4f2076c197d8092d921a1ea75bd08af97398f593751892"
709
707
  dependencies = [
710
708
  "proc-macro2",
711
709
  "quote",
712
- "syn",
710
+ "syn 2.0.119",
713
711
  ]
714
712
 
715
713
  [[package]]
@@ -742,9 +740,9 @@ dependencies = [
742
740
 
743
741
  [[package]]
744
742
  name = "mio"
745
- version = "1.2.1"
743
+ version = "1.2.2"
746
744
  source = "registry+https://github.com/rust-lang/crates.io-index"
747
- checksum = "02bd0af71c67b473010cbbc60715ee815645a4dc942899111f494b4b737d6fda"
745
+ checksum = "30d65c71f1ce40ab09135ce117d742b9f8a19ff91a41a8b57ed50bc2de59c427"
748
746
  dependencies = [
749
747
  "libc",
750
748
  "wasi",
@@ -763,9 +761,9 @@ dependencies = [
763
761
 
764
762
  [[package]]
765
763
  name = "num-conv"
766
- version = "0.1.0"
764
+ version = "0.2.2"
767
765
  source = "registry+https://github.com/rust-lang/crates.io-index"
768
- checksum = "51d515d32fb182ee37cda2ccdcb92950d6a3c2893aa280e540671c2cd0f3b1d9"
766
+ checksum = "521739c6d2bac4aa25192232afe6841231376b2b26d4d9fae5ecf8ca5772e441"
769
767
 
770
768
  [[package]]
771
769
  name = "openssl-macros"
@@ -775,7 +773,7 @@ checksum = "a948666b637a0f465e8564c73e89d4dde00d72d4d473cc972f390fc3dcee7d9c"
775
773
  dependencies = [
776
774
  "proc-macro2",
777
775
  "quote",
778
- "syn",
776
+ "syn 2.0.119",
779
777
  ]
780
778
 
781
779
  [[package]]
@@ -836,18 +834,18 @@ checksum = "439ee305def115ba05938db6eb1644ff94165c5ab5e9420d1c1bcedbba909391"
836
834
 
837
835
  [[package]]
838
836
  name = "proc-macro2"
839
- version = "1.0.106"
837
+ version = "1.0.107"
840
838
  source = "registry+https://github.com/rust-lang/crates.io-index"
841
- checksum = "8fd00f0bb2e90d81d1044c2b32617f68fcb9fa3bb7640c23e9c748e53fb30934"
839
+ checksum = "985e7ec9bb745e6ce6535b544d84d6cd6f7ad8bd711c398938ae983b91a766d9"
842
840
  dependencies = [
843
841
  "unicode-ident",
844
842
  ]
845
843
 
846
844
  [[package]]
847
845
  name = "quote"
848
- version = "1.0.46"
846
+ version = "1.0.47"
849
847
  source = "registry+https://github.com/rust-lang/crates.io-index"
850
- checksum = "dfbc457d0c7a0759a614551b11a6409e5951f6c7537be1f1b7682b9ae9230368"
848
+ checksum = "1fbf4db142a473a8d80c26bbf18454ed458bf8d26c8219c331daecfdbd079001"
851
849
  dependencies = [
852
850
  "proc-macro2",
853
851
  ]
@@ -879,7 +877,7 @@ dependencies = [
879
877
  "quote",
880
878
  "regex",
881
879
  "shell-words",
882
- "syn",
880
+ "syn 2.0.119",
883
881
  ]
884
882
 
885
883
  [[package]]
@@ -899,9 +897,9 @@ dependencies = [
899
897
 
900
898
  [[package]]
901
899
  name = "regex"
902
- version = "1.13.0"
900
+ version = "1.13.1"
903
901
  source = "registry+https://github.com/rust-lang/crates.io-index"
904
- checksum = "2a0e75113e14dc5acb068cd0786884f214f1312650a3d36d269f5c4f3cdee8a2"
902
+ checksum = "f020237b6c8eed93db2e2cb53c00c60a8e1bc73da7d073199a1180401450218d"
905
903
  dependencies = [
906
904
  "aho-corasick",
907
905
  "memchr",
@@ -911,9 +909,9 @@ dependencies = [
911
909
 
912
910
  [[package]]
913
911
  name = "regex-automata"
914
- version = "0.4.15"
912
+ version = "0.4.16"
915
913
  source = "registry+https://github.com/rust-lang/crates.io-index"
916
- checksum = "1f388202e4b80542a0921078cc23b6333bcf1409c1e3f86404cae4766a6131db"
914
+ checksum = "8fcfdb36bda0c880c5931cdc7a2bcdc8ba4556847b9d912bca70bc94708711ad"
917
915
  dependencies = [
918
916
  "aho-corasick",
919
917
  "memchr",
@@ -934,9 +932,9 @@ checksum = "6b1e7f9a428571be2dc5bc0505c13fb6bf936822b894ec87abf8a08a4e51742d"
934
932
 
935
933
  [[package]]
936
934
  name = "rustls-pki-types"
937
- version = "1.15.0"
935
+ version = "1.15.1"
938
936
  source = "registry+https://github.com/rust-lang/crates.io-index"
939
- checksum = "764899a24af3980067ee14bc143654f297b22eaebfe3c7b6b211920a5a59b046"
937
+ checksum = "2f4925028c7eb5d1fcdaf196971378ed9d2c1c4efc7dc5d011256f76c99c0a96"
940
938
 
941
939
  [[package]]
942
940
  name = "rustversion"
@@ -958,9 +956,9 @@ checksum = "1bc711410fbe7399f390ca1c3b60ad0f53f80e95c5eb935e52268a0e2cd49acc"
958
956
 
959
957
  [[package]]
960
958
  name = "serde"
961
- version = "1.0.228"
959
+ version = "1.0.229"
962
960
  source = "registry+https://github.com/rust-lang/crates.io-index"
963
- checksum = "9a8e94ea7f378bd32cbbd37198a4a91436180c5bb472411e48b5ec2e2124ae9e"
961
+ checksum = "4148590afebada386688f18773da617792bf2ef03ffc1e4cbd2b1d45b023e0ba"
964
962
  dependencies = [
965
963
  "serde_core",
966
964
  "serde_derive",
@@ -968,22 +966,22 @@ dependencies = [
968
966
 
969
967
  [[package]]
970
968
  name = "serde_core"
971
- version = "1.0.228"
969
+ version = "1.0.229"
972
970
  source = "registry+https://github.com/rust-lang/crates.io-index"
973
- checksum = "41d385c7d4ca58e59fc732af25c3983b67ac852c1a25000afe1175de458b67ad"
971
+ checksum = "67dca2c9c51e58a4791a4b1ed58308b39c64224d349a935ab5039aa360942a48"
974
972
  dependencies = [
975
973
  "serde_derive",
976
974
  ]
977
975
 
978
976
  [[package]]
979
977
  name = "serde_derive"
980
- version = "1.0.228"
978
+ version = "1.0.229"
981
979
  source = "registry+https://github.com/rust-lang/crates.io-index"
982
- checksum = "d540f220d3187173da220f885ab66608367b6574e925011a9353e4badda91d79"
980
+ checksum = "e7a5d71263a5a7d47b41f6b3f06ba276f10cc18b0931f1799f710578e2309348"
983
981
  dependencies = [
984
982
  "proc-macro2",
985
983
  "quote",
986
- "syn",
984
+ "syn 3.0.3",
987
985
  ]
988
986
 
989
987
  [[package]]
@@ -1011,9 +1009,9 @@ dependencies = [
1011
1009
 
1012
1010
  [[package]]
1013
1011
  name = "serde_json"
1014
- version = "1.0.150"
1012
+ version = "1.0.151"
1015
1013
  source = "registry+https://github.com/rust-lang/crates.io-index"
1016
- checksum = "e8014e44b4736ed0538adeecded0fce2a272f22dc9578a7eb6b2d9993c74cfb9"
1014
+ checksum = "c841b55ecdae098c80dcae9cf767f6f8a0c2cdb3416bbef72181df4d0fe73f14"
1017
1015
  dependencies = [
1018
1016
  "indexmap",
1019
1017
  "itoa",
@@ -1064,9 +1062,9 @@ dependencies = [
1064
1062
 
1065
1063
  [[package]]
1066
1064
  name = "simd-adler32"
1067
- version = "0.3.9"
1065
+ version = "0.3.10"
1068
1066
  source = "registry+https://github.com/rust-lang/crates.io-index"
1069
- checksum = "703d5c7ef118737c72f1af64ad2f6f8c5e1921f818cdcb97b8fe6fc69bf66214"
1067
+ checksum = "3a219298ac11a56ea9a6d2120044824d6f01aeb034955e7af7bc16858527deea"
1070
1068
 
1071
1069
  [[package]]
1072
1070
  name = "slab"
@@ -1082,9 +1080,9 @@ checksum = "8ed6a63f02c8539c91a8685a86f4099661ba3da017932f6ebbea6de3f0fa7c90"
1082
1080
 
1083
1081
  [[package]]
1084
1082
  name = "socket2"
1085
- version = "0.6.4"
1083
+ version = "0.6.5"
1086
1084
  source = "registry+https://github.com/rust-lang/crates.io-index"
1087
- checksum = "52d1cfed4120b4d927bf7c0f86d2087a4a7d6027c906d9f9d525a80573b9be51"
1085
+ checksum = "c3d1e2c7f27f8d4cb10542a02c49005dbd6e93095799d6f3be745fae9f8fedd4"
1088
1086
  dependencies = [
1089
1087
  "libc",
1090
1088
  "windows-sys",
@@ -1098,9 +1096,20 @@ checksum = "6ce2be8dc25455e1f91df71bfa12ad37d7af1092ae736f3a6cd0e37bc7810596"
1098
1096
 
1099
1097
  [[package]]
1100
1098
  name = "syn"
1101
- version = "2.0.118"
1099
+ version = "2.0.119"
1100
+ source = "registry+https://github.com/rust-lang/crates.io-index"
1101
+ checksum = "872831b642d1a07999a962a351ed35b955ea2cfc8f3862091e2a240a84f17297"
1102
+ dependencies = [
1103
+ "proc-macro2",
1104
+ "quote",
1105
+ "unicode-ident",
1106
+ ]
1107
+
1108
+ [[package]]
1109
+ name = "syn"
1110
+ version = "3.0.3"
1102
1111
  source = "registry+https://github.com/rust-lang/crates.io-index"
1103
- checksum = "1b9ae57f904213ebb649ce6895b8a66c66f0203b9319718f69a5612a065b1422"
1112
+ checksum = "53e9bae58849f64dfa4f5d5ae372c8341f7305f82a3868709269343628b659a3"
1104
1113
  dependencies = [
1105
1114
  "proc-macro2",
1106
1115
  "quote",
@@ -1124,7 +1133,7 @@ checksum = "728a70f3dbaf5bab7f0c4b1ac8d7ae5ea60a4b5549c8a5914361c99147a709d2"
1124
1133
  dependencies = [
1125
1134
  "proc-macro2",
1126
1135
  "quote",
1127
- "syn",
1136
+ "syn 2.0.119",
1128
1137
  ]
1129
1138
 
1130
1139
  [[package]]
@@ -1165,17 +1174,16 @@ checksum = "4fee6c4efc90059e10f81e6d42c60a18f76588c3d74cb83a0b242a2b6c7504c1"
1165
1174
  dependencies = [
1166
1175
  "proc-macro2",
1167
1176
  "quote",
1168
- "syn",
1177
+ "syn 2.0.119",
1169
1178
  ]
1170
1179
 
1171
1180
  [[package]]
1172
1181
  name = "time"
1173
- version = "0.3.45"
1182
+ version = "0.3.54"
1174
1183
  source = "registry+https://github.com/rust-lang/crates.io-index"
1175
- checksum = "f9e442fc33d7fdb45aa9bfeb312c095964abdf596f7567261062b2a7107aaabd"
1184
+ checksum = "3e1d5e639ff6bab73cb6885cc7e7b1de96c3f32c68ec55f3952614bec1092244"
1176
1185
  dependencies = [
1177
1186
  "deranged",
1178
- "itoa",
1179
1187
  "num-conv",
1180
1188
  "powerfmt",
1181
1189
  "serde_core",
@@ -1185,15 +1193,15 @@ dependencies = [
1185
1193
 
1186
1194
  [[package]]
1187
1195
  name = "time-core"
1188
- version = "0.1.7"
1196
+ version = "0.1.9"
1189
1197
  source = "registry+https://github.com/rust-lang/crates.io-index"
1190
- checksum = "8b36ee98fd31ec7426d599183e8fe26932a8dc1fb76ddb6214d05493377d34ca"
1198
+ checksum = "9e1c906769ad99c88eaa54e728060edef082f8e358ff32030cb7c7d315e81109"
1191
1199
 
1192
1200
  [[package]]
1193
1201
  name = "time-macros"
1194
- version = "0.2.25"
1202
+ version = "0.2.32"
1195
1203
  source = "registry+https://github.com/rust-lang/crates.io-index"
1196
- checksum = "71e552d1249bf61ac2a52db88179fd0673def1e1ad8243a00d9ec9ed71fee3dd"
1204
+ checksum = "7e689342a48d2ea927c87ea50cabf8594854bf940e9310208848d680d668ed85"
1197
1205
  dependencies = [
1198
1206
  "num-conv",
1199
1207
  "time-core",
@@ -1211,9 +1219,9 @@ dependencies = [
1211
1219
 
1212
1220
  [[package]]
1213
1221
  name = "tokio"
1214
- version = "1.52.3"
1222
+ version = "1.53.1"
1215
1223
  source = "registry+https://github.com/rust-lang/crates.io-index"
1216
- checksum = "8fc7f01b389ac15039e4dc9531aa973a135d7a4135281b12d7c1bc79fd57fffe"
1224
+ checksum = "202caea871b69668250d242070849eb495be178ed697a3e98aebce5bc81a0bed"
1217
1225
  dependencies = [
1218
1226
  "bytes",
1219
1227
  "libc",
@@ -1238,13 +1246,13 @@ dependencies = [
1238
1246
 
1239
1247
  [[package]]
1240
1248
  name = "tokio-macros"
1241
- version = "2.7.0"
1249
+ version = "2.7.1"
1242
1250
  source = "registry+https://github.com/rust-lang/crates.io-index"
1243
- checksum = "385a6cb71ab9ab790c5fe8d67f1645e6c450a7ce006a33de03daa956cf70a496"
1251
+ checksum = "6328af13490e73a9b4694030fafd93f8c8c6a9dede33e821c3fc63eddf8042ba"
1244
1252
  dependencies = [
1245
1253
  "proc-macro2",
1246
1254
  "quote",
1247
- "syn",
1255
+ "syn 2.0.119",
1248
1256
  ]
1249
1257
 
1250
1258
  [[package]]
@@ -1261,13 +1269,14 @@ dependencies = [
1261
1269
 
1262
1270
  [[package]]
1263
1271
  name = "tokio-util"
1264
- version = "0.7.18"
1272
+ version = "0.7.19"
1265
1273
  source = "registry+https://github.com/rust-lang/crates.io-index"
1266
- checksum = "9ae9cec805b01e8fc3fd2fe289f89149a9b66dd16786abd8b19cfa7b48cb0098"
1274
+ checksum = "494815d09bf52b5548659851081238f0ca39ff638363907596da739561c62c52"
1267
1275
  dependencies = [
1268
1276
  "bytes",
1269
1277
  "futures-core",
1270
1278
  "futures-sink",
1279
+ "libc",
1271
1280
  "pin-project-lite",
1272
1281
  "tokio",
1273
1282
  ]
@@ -1342,7 +1351,7 @@ checksum = "076a02dc54dd46795c2e9c8282ed40bcfb1e22747e955de9389a1de28190fb26"
1342
1351
  dependencies = [
1343
1352
  "proc-macro2",
1344
1353
  "quote",
1345
- "syn",
1354
+ "syn 2.0.119",
1346
1355
  ]
1347
1356
 
1348
1357
  [[package]]
@@ -1392,9 +1401,9 @@ checksum = "ccf3ec651a847eb01de73ccad15eb7d99f80485de043efb2f370cd654f4ea44b"
1392
1401
 
1393
1402
  [[package]]
1394
1403
  name = "webpki-root-certs"
1395
- version = "1.0.8"
1404
+ version = "1.0.9"
1396
1405
  source = "registry+https://github.com/rust-lang/crates.io-index"
1397
- checksum = "0d46a5a140e6f7afeccd8eae97eff335163939eac8b929834875168b29b3d267"
1406
+ checksum = "b96554aa2acc8ccdb7e1c9a58a7a68dd5d13bccc69cd124cb09406db612a1c9b"
1398
1407
  dependencies = [
1399
1408
  "rustls-pki-types",
1400
1409
  ]
@@ -1540,7 +1549,7 @@ dependencies = [
1540
1549
 
1541
1550
  [[package]]
1542
1551
  name = "wreq-ruby"
1543
- version = "1.2.6"
1552
+ version = "1.2.7"
1544
1553
  dependencies = [
1545
1554
  "arc-swap",
1546
1555
  "bytes",
@@ -1597,7 +1606,7 @@ checksum = "de844c262c8848816172cef550288e7dc6c7b7814b4ee56b3e1553f275f1858e"
1597
1606
  dependencies = [
1598
1607
  "proc-macro2",
1599
1608
  "quote",
1600
- "syn",
1609
+ "syn 2.0.119",
1601
1610
  "synstructure",
1602
1611
  ]
1603
1612
 
@@ -1618,7 +1627,7 @@ checksum = "11532158c46691caf0f2593ea8358fed6bbf68a0315e80aae9bd41fbade684a1"
1618
1627
  dependencies = [
1619
1628
  "proc-macro2",
1620
1629
  "quote",
1621
- "syn",
1630
+ "syn 2.0.119",
1622
1631
  "synstructure",
1623
1632
  ]
1624
1633
 
@@ -1652,14 +1661,14 @@ checksum = "625dc425cab0dca6dc3c3319506e6593dcb08a9f387ea3b284dbd52a92c40555"
1652
1661
  dependencies = [
1653
1662
  "proc-macro2",
1654
1663
  "quote",
1655
- "syn",
1664
+ "syn 2.0.119",
1656
1665
  ]
1657
1666
 
1658
1667
  [[package]]
1659
1668
  name = "zmij"
1660
- version = "1.0.21"
1669
+ version = "1.0.23"
1661
1670
  source = "registry+https://github.com/rust-lang/crates.io-index"
1662
- checksum = "b8848ee67ecc8aedbaf3e4122217aff892639231befc6a1b58d29fff4c2cabaa"
1671
+ checksum = "29666d0abbfad1e3dc4dcf6144730dd3a3ab225bbbdac83319345b1b44ccfc1b"
1663
1672
 
1664
1673
  [[package]]
1665
1674
  name = "zstd"
data/Cargo.toml CHANGED
@@ -5,8 +5,8 @@ authors = ["SearchApi <support@searchapi.io>"]
5
5
  homepage = "https://github.com/SearchApi/wreq-ruby"
6
6
  repository = "https://github.com/SearchApi/wreq-ruby"
7
7
  edition = "2024"
8
- rust-version = "1.85"
9
- version = "1.2.6"
8
+ version = "1.2.7"
9
+ rust-version = "1.95"
10
10
 
11
11
  [lib]
12
12
  crate-type = ["cdylib"]
data/Rakefile CHANGED
@@ -1,5 +1,11 @@
1
1
  # frozen_string_literal: true
2
2
 
3
+ require_relative "script/rust_env"
4
+
5
+ # Cargo needs RubyInstaller's UCRT tools when Rake builds the native extension
6
+ # on Windows. Other platforms keep their existing native Cargo environment.
7
+ Wreq::RustEnv.activate
8
+
3
9
  require "bundler/gem_tasks"
4
10
  require "rake/testtask"
5
11
  require "rb_sys/extensiontask"
@@ -43,7 +43,7 @@ async fn main() -> wreq::Result<()> {
43
43
  .build()?;
44
44
 
45
45
  // Use the API you're already familiar with
46
- let resp = client.get("https://www.google.com").send().await?;
46
+ let resp = client.get("https://pingly.us.kg/api/all").send().await?;
47
47
  println!("{}", resp.text().await?);
48
48
  Ok(())
49
49
  }
@@ -3,7 +3,7 @@ use wreq_util::{Emulation, Platform, Profile};
3
3
  #[tokio::main]
4
4
  async fn main() -> Result<(), wreq::Error> {
5
5
  // Example 1: Basic emulation - Safari26
6
- let text = wreq::get("https://tls.browserleaks.com/")
6
+ let text = wreq::get("https://pingly.us.kg/api/all")
7
7
  .emulation(Emulation::Safari26)
8
8
  .send()
9
9
  .await?
@@ -12,7 +12,7 @@ async fn main() -> Result<(), wreq::Error> {
12
12
  println!("{}\n", text);
13
13
 
14
14
  // Example 2: Advanced emulation with options - OkHttp5
15
- let text = wreq::get("https://tls.peet.ws/api/all")
15
+ let text = wreq::get("https://pingly.us.kg/api/all")
16
16
  .emulation(
17
17
  Emulation::builder()
18
18
  .profile(Profile::OkHttp5)
@@ -27,7 +27,7 @@ async fn main() -> Result<(), wreq::Error> {
27
27
  println!("{}\n", text);
28
28
 
29
29
  // Example 3: Random device emulation
30
- let text = wreq::get("https://tls.peet.ws/api/all")
30
+ let text = wreq::get("https://pingly.us.kg/api/all")
31
31
  .emulation(Emulation::random())
32
32
  .send()
33
33
  .await?
@@ -110,7 +110,7 @@ macro_rules! header_chrome_ua {
110
110
 
111
111
  macro_rules! header_chrome_accept {
112
112
  ($headers:expr) => {
113
- $headers.insert(ACCEPT, HeaderValue::from_static("text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.9"));
113
+ $headers.insert(ACCEPT, HeaderValue::from_static("text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.7"));
114
114
  };
115
115
  }
116
116
 
@@ -57,14 +57,60 @@ DLL Name: KERNEL32.dll
57
57
  problematic `Sleep` reference can come from Rust std, MinGW, or pthread-related
58
58
  linking paths, not only from `windows-sys`.
59
59
 
60
- Verified with:
60
+ Windows builds use the `x86_64-pc-windows-gnu` target and the RubyInstaller
61
+ UCRT toolchain. The Rakefile configures that environment automatically, so the
62
+ extension and tests can be built with:
61
63
 
62
64
  ```powershell
63
- .\script\build_windows_gnu.ps1 -SkipBundleInstall -SkipToolInstall -RunTests
65
+ rustup target add x86_64-pc-windows-gnu
66
+ ridk exec pacman -S --needed --noconfirm `
67
+ mingw-w64-ucrt-x86_64-gcc `
68
+ mingw-w64-ucrt-x86_64-clang `
69
+ mingw-w64-ucrt-x86_64-cmake `
70
+ mingw-w64-ucrt-x86_64-pkgconf
71
+ bundle exec rake test
64
72
  ```
65
73
 
74
+ The first Rake invocation also writes a machine-local `.cargo/windows.toml`.
75
+ The checked-in `.cargo/config.toml` loads it automatically, so Cargo and Rust
76
+ language servers use the same GNU target and RubyInstaller tools without
77
+ editor-specific settings.
78
+
79
+ ## RubyInstaller development tools
80
+
81
+ RubyInstaller adds Ruby itself to `PATH`, but it does not enable the bundled
82
+ MSYS2 development environment globally. Running `ridk enable` adds tools such
83
+ as GCC, CMake, and Make to the current terminal only. This is normally useful
84
+ because it avoids conflicts with other Windows toolchains.
85
+
86
+ Rust language servers start Cargo directly and do not run `ridk enable` or the
87
+ Rakefile first. Add RubyInstaller's `ucrt64\bin` and `usr\bin` directories to
88
+ the user `PATH` so Cargo can load GCC, libclang, and their dependent DLLs from
89
+ any editor:
90
+
91
+ ```powershell
92
+ $rubyRoot = ruby -rrbconfig -e "print RbConfig::CONFIG.fetch('prefix')"
93
+ $required = @(
94
+ (Join-Path $rubyRoot "msys64\ucrt64\bin"),
95
+ (Join-Path $rubyRoot "msys64\usr\bin")
96
+ )
97
+ $userPath = [Environment]::GetEnvironmentVariable("Path", "User")
98
+ $entries = @($userPath -split ";" | Where-Object {
99
+ $_ -and $_ -notin $required
100
+ })
101
+ $entries = $required + $entries
102
+ [Environment]::SetEnvironmentVariable("Path", ($entries -join ";"), "User")
103
+ ```
104
+
105
+ Restart the editor after changing `PATH` so its language server inherits the
106
+ updated environment. Run `bundle exec rake compile` once after installing or
107
+ switching Ruby so `.cargo/windows.toml` points to the active RubyInstaller.
108
+ Run a Rake command after switching the same checkout between Windows and WSL;
109
+ Windows generates this local configuration, while other platforms remove it.
110
+
66
111
  Result:
67
112
 
68
113
  ```text
69
- 160 runs, 775 assertions, 0 failures, 0 errors
114
+ 254 runs, 1198 assertions, 0 failures, 0 errors
115
+ 2 Rust tests passed
70
116
  ```
data/extconf.rb CHANGED
@@ -1,4 +1,8 @@
1
1
  require "mkmf"
2
+ require_relative "script/rust_env"
3
+
4
+ Wreq::RustEnv.activate
5
+
2
6
  # We use rb_sys for makefile generation only.
3
7
  # We can use `RB_SYS_CARGO_PROFILE` to choose Cargo profile
4
8
  # Read more https://github.com/oxidize-rb/rb-sys/blob/main/gem/README.md
@@ -0,0 +1,85 @@
1
+ # frozen_string_literal: true
2
+
3
+ require "rbconfig"
4
+ require "fileutils"
5
+
6
+ module Wreq
7
+ module RustEnv
8
+ WINDOWS_GNU_TARGET = "x86_64-pc-windows-gnu"
9
+ WINDOWS_RUBY_PLATFORM = "x64-mingw-ucrt"
10
+
11
+ # Uses the UCRT toolchain shipped with the active RubyInstaller installation.
12
+ def self.activate
13
+ unless RbConfig::CONFIG["host_os"].match?(/mingw|mswin/)
14
+ FileUtils.rm_f(cargo_config_path)
15
+ return
16
+ end
17
+
18
+ ruby_platform = RbConfig::CONFIG.fetch("arch")
19
+ unless ruby_platform == WINDOWS_RUBY_PLATFORM
20
+ raise "Unsupported Windows Ruby platform: #{ruby_platform}. " \
21
+ "Use RubyInstaller UCRT (#{WINDOWS_RUBY_PLATFORM})."
22
+ end
23
+
24
+ ruby_root = RbConfig::CONFIG.fetch("prefix")
25
+ msys_root = File.join(ruby_root, "msys64")
26
+ ucrt_bin = File.join(msys_root, "ucrt64", "bin")
27
+ msys_bin = File.join(msys_root, "usr", "bin")
28
+
29
+ validate_tools(ucrt_bin, msys_bin)
30
+ write_cargo_config(ucrt_bin, msys_bin)
31
+ ENV["CARGO_BUILD_TARGET"] = WINDOWS_GNU_TARGET
32
+ ENV["LIBCLANG_PATH"] = ucrt_bin
33
+ ENV.delete("CMAKE_GENERATOR")
34
+ ENV["PATH"] = [ucrt_bin, msys_bin, ENV.fetch("PATH", nil)].compact.join(File::PATH_SEPARATOR)
35
+ end
36
+
37
+ # Reports missing RubyInstaller packages before Cargo starts compiling.
38
+ def self.validate_tools(ucrt_bin, msys_bin)
39
+ required = %w[gcc.exe g++.exe gcc-ar.exe clang.exe libclang.dll cmake.exe]
40
+ .map { |tool| File.join(ucrt_bin, tool) }
41
+ .append(File.join(msys_bin, "make.exe"))
42
+ missing = required.reject { |tool| File.file?(tool) }
43
+ unless %w[pkgconf.exe pkg-config.exe].any? { |tool| File.file?(File.join(ucrt_bin, tool)) }
44
+ missing << File.join(ucrt_bin, "pkgconf.exe")
45
+ end
46
+ return if missing.empty?
47
+
48
+ raise "Missing RubyInstaller UCRT tools: #{missing.join(", ")}. " \
49
+ "Install the Windows build dependencies documented in " \
50
+ "docs/windows-gnu-tokio-crash.md."
51
+ end
52
+
53
+ # Generates machine-local Cargo defaults that work in command lines and IDEs.
54
+ def self.write_cargo_config(ucrt_bin, msys_bin)
55
+ config = <<~TOML
56
+ # Generated by script/rust_env.rb for the active RubyInstaller.
57
+
58
+ [build]
59
+ target = "#{WINDOWS_GNU_TARGET}"
60
+
61
+ [target.#{WINDOWS_GNU_TARGET}]
62
+ linker = "#{File.join(ucrt_bin, "gcc.exe")}"
63
+
64
+ [env]
65
+ CC_x86_64_pc_windows_gnu = { value = "#{File.join(ucrt_bin, "gcc.exe")}", force = true }
66
+ CXX_x86_64_pc_windows_gnu = { value = "#{File.join(ucrt_bin, "g++.exe")}", force = true }
67
+ AR_x86_64_pc_windows_gnu = { value = "#{File.join(ucrt_bin, "gcc-ar.exe")}", force = true }
68
+ CMAKE = { value = "#{File.join(ucrt_bin, "cmake.exe")}", force = true }
69
+ CMAKE_GENERATOR = { value = "MSYS Makefiles", force = true }
70
+ CMAKE_MAKE_PROGRAM = { value = "#{File.join(msys_bin, "make.exe")}", force = true }
71
+ LIBCLANG_PATH = { value = "#{ucrt_bin}", force = true }
72
+ TOML
73
+
74
+ return if File.exist?(cargo_config_path) && File.binread(cargo_config_path) == config
75
+
76
+ FileUtils.mkdir_p(File.dirname(cargo_config_path))
77
+ File.binwrite(cargo_config_path, config)
78
+ end
79
+
80
+ # Returns the ignored Cargo configuration shared by Rake and language servers.
81
+ def self.cargo_config_path
82
+ File.expand_path("../.cargo/windows.toml", __dir__)
83
+ end
84
+ end
85
+ end
data/wreq.gemspec CHANGED
@@ -56,7 +56,7 @@ Gem::Specification.new do |spec|
56
56
  # Exclude non-Ruby files from RDoc to prevent parsing errors
57
57
  spec.rdoc_options = ["--exclude", "Cargo\\..*", "--exclude", "\\.rs$"]
58
58
 
59
- spec.requirements = ["Rust >= 1.85"]
59
+ spec.requirements = ["Rust >= 1.97"]
60
60
  # use a Ruby version which:
61
61
  # - supports Rubygems with the ability of compilation of Rust gem
62
62
  # - not end of life
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: wreq
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.2.6
4
+ version: 1.2.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - SearchApi
@@ -20,6 +20,7 @@ extensions:
20
20
  extra_rdoc_files: []
21
21
  files:
22
22
  - "./extconf.rb"
23
+ - ".cargo/config.toml"
23
24
  - Cargo.lock
24
25
  - Cargo.toml
25
26
  - Gemfile
@@ -100,7 +101,7 @@ files:
100
101
  - lib/wreq_ruby/http.rb
101
102
  - lib/wreq_ruby/response.rb
102
103
  - script/build_platform_gem.rb
103
- - script/build_windows_gnu.ps1
104
+ - script/rust_env.rb
104
105
  - src/arch.rs
105
106
  - src/client.rs
106
107
  - src/client/body.rs
@@ -188,7 +189,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
188
189
  - !ruby/object:Gem::Version
189
190
  version: '0'
190
191
  requirements:
191
- - Rust >= 1.85
192
+ - Rust >= 1.97
192
193
  rubygems_version: 3.6.9
193
194
  specification_version: 4
194
195
  summary: Ruby bindings for wreq, an HTTP client with TLS/HTTP2 browser fingerprinting
@@ -1,270 +0,0 @@
1
- param(
2
- [switch]$SkipBundleInstall,
3
- [switch]$SkipToolInstall,
4
- [switch]$BuildGem,
5
- [switch]$TestGem,
6
- [switch]$RunTests,
7
- [string]$SmokeUrl = $env:WREQ_SMOKE_URL
8
- )
9
-
10
- $ErrorActionPreference = "Stop"
11
-
12
- $target = "x86_64-pc-windows-gnu"
13
- $platform = "x64-mingw-ucrt"
14
- $gemPattern = "pkg\wreq-*-$platform.gem"
15
- if ([string]::IsNullOrWhiteSpace($SmokeUrl)) {
16
- $SmokeUrl = "https://httpbin.io/get"
17
- }
18
- $rubyRoot = Split-Path (Split-Path (Get-Command ruby).Source -Parent) -Parent
19
- $ucrt = Join-Path $rubyRoot "msys64\ucrt64"
20
- $ucrtBin = Join-Path $ucrt "bin"
21
- $msysPackages = @(
22
- "mingw-w64-ucrt-x86_64-gcc",
23
- "mingw-w64-ucrt-x86_64-clang",
24
- "mingw-w64-ucrt-x86_64-cmake",
25
- "mingw-w64-ucrt-x86_64-pkgconf"
26
- )
27
-
28
- function Invoke-Step {
29
- param(
30
- [string]$Name,
31
- [scriptblock]$Command
32
- )
33
-
34
- Write-Host "==> $Name"
35
- # Native command failures do not honor ErrorActionPreference in Windows PowerShell.
36
- $global:LASTEXITCODE = 0
37
- & $Command
38
- if ($LASTEXITCODE -ne 0) {
39
- throw "$Name failed with exit code $LASTEXITCODE."
40
- }
41
- }
42
-
43
- function Get-MissingUcrtTools {
44
- $missing = @()
45
-
46
- if (-not (Test-Path (Join-Path $ucrtBin "gcc.exe")) -or -not (Test-Path (Join-Path $ucrtBin "g++.exe"))) {
47
- $missing += "gcc/g++"
48
- }
49
-
50
- if (-not (Test-Path (Join-Path $ucrtBin "clang.exe")) -or -not (Test-Path (Join-Path $ucrtBin "libclang.dll"))) {
51
- $missing += "clang/libclang"
52
- }
53
-
54
- if (-not (Test-Path (Join-Path $ucrtBin "cmake.exe"))) {
55
- $missing += "cmake"
56
- }
57
-
58
- if (-not (Test-Path (Join-Path $ucrtBin "pkgconf.exe")) -and -not (Test-Path (Join-Path $ucrtBin "pkg-config.exe"))) {
59
- $missing += "pkgconf"
60
- }
61
-
62
- $missing
63
- }
64
-
65
- function Get-LatestPlatformGem {
66
- $gem = Get-ChildItem -Path $gemPattern -ErrorAction SilentlyContinue |
67
- Sort-Object LastWriteTime -Descending |
68
- Select-Object -First 1
69
-
70
- if (-not $gem) {
71
- throw "No Windows GNU platform gem found at '$gemPattern'. Re-run with -BuildGem first."
72
- }
73
-
74
- $gem
75
- }
76
-
77
- function Invoke-RubySmoke {
78
- param(
79
- [string]$Name,
80
- [string]$Code
81
- )
82
-
83
- Write-Host "Smoke: $Name"
84
- ruby -e $Code
85
- if ($LASTEXITCODE -ne 0) {
86
- throw "$Name failed with exit code $LASTEXITCODE."
87
- }
88
- }
89
-
90
- Invoke-Step "Check Ruby platform" {
91
- $rubyArch = & ruby -rrbconfig -e "print RbConfig::CONFIG['arch']"
92
- if ($rubyArch -ne $platform) {
93
- throw "Expected Ruby platform '$platform', got '$rubyArch'. Use RubyInstaller UCRT for this build."
94
- }
95
-
96
- ruby -v
97
- ruby -rrbconfig -rrubygems -e "puts RbConfig::CONFIG.values_at('arch', 'host', 'CC').join(%q{ }); puts Gem::Platform.local"
98
- }
99
-
100
- Invoke-Step "Install Rust target" {
101
- $installedTargets = @(rustup target list --installed)
102
- if ($installedTargets -contains $target) {
103
- Write-Host "Rust target $target already installed; skipping rustup."
104
- return
105
- }
106
-
107
- rustup target add $target
108
- if ($LASTEXITCODE -ne 0) {
109
- throw "Failed to install Rust target $target."
110
- }
111
- }
112
-
113
- Invoke-Step "Check MSYS2 UCRT build tools" {
114
- $missing = @(Get-MissingUcrtTools)
115
- if ($missing.Count -eq 0) {
116
- Write-Host "MSYS2 UCRT build tools already present; skipping pacman."
117
- return
118
- }
119
-
120
- if ($SkipToolInstall) {
121
- throw "Missing MSYS2 UCRT build tools: $($missing -join ', '). Re-run without -SkipToolInstall or install them with ridk."
122
- }
123
-
124
- Write-Host "Missing MSYS2 UCRT build tools: $($missing -join ', ')"
125
- ridk exec pacman -S --needed --noconfirm @msysPackages
126
- if ($LASTEXITCODE -ne 0) {
127
- $stillMissing = @(Get-MissingUcrtTools)
128
- if ($stillMissing.Count -eq 0) {
129
- Write-Warning "pacman returned exit code $LASTEXITCODE, but all required tools are present; continuing."
130
- $global:LASTEXITCODE = 0
131
- return
132
- }
133
-
134
- throw "Failed to install MSYS2 UCRT build tools. Missing: $($stillMissing -join ', '). If pacman cannot lock its database, close other pacman/ridk shells, run PowerShell as Administrator, or install RubyInstaller in a user-writable directory."
135
- }
136
- }
137
-
138
- Invoke-Step "Configure Windows GNU toolchain" {
139
- $env:CARGO_BUILD_TARGET = $target
140
- $env:LIBCLANG_PATH = $ucrtBin
141
- $env:CC_x86_64_pc_windows_gnu = Join-Path $ucrtBin "gcc.exe"
142
- $env:CXX_x86_64_pc_windows_gnu = Join-Path $ucrtBin "g++.exe"
143
- $env:CMAKE = Join-Path $ucrtBin "cmake.exe"
144
- Remove-Item Env:\CMAKE_GENERATOR -ErrorAction SilentlyContinue
145
-
146
- rustc -Vv
147
- Write-Host "LIBCLANG_PATH=$env:LIBCLANG_PATH"
148
- Write-Host "CC_x86_64_pc_windows_gnu=$env:CC_x86_64_pc_windows_gnu"
149
- Write-Host "CXX_x86_64_pc_windows_gnu=$env:CXX_x86_64_pc_windows_gnu"
150
- Write-Host "CMAKE=$env:CMAKE"
151
- }
152
-
153
- if (-not $SkipBundleInstall) {
154
- Invoke-Step "Install Ruby dependencies" {
155
- bundle install
156
- }
157
- }
158
-
159
- Invoke-Step "Compile native extension" {
160
- ridk exec ruby -S bundle exec rake compile
161
- }
162
-
163
- Invoke-Step "Sync versioned extension" {
164
- $rubyMinor = & ruby -e "print RUBY_VERSION[/\A\d+\.\d+/]"
165
- $dest = "lib\wreq_ruby\$rubyMinor"
166
- New-Item -ItemType Directory -Force $dest | Out-Null
167
- Copy-Item "lib\wreq_ruby\wreq_ruby.so" (Join-Path $dest "wreq_ruby.so") -Force
168
- }
169
-
170
- Invoke-Step "Verify extension loads" {
171
- ruby -Ilib -rwreq -e "puts Wreq::VERSION; puts Wreq::Client.new.class"
172
- }
173
-
174
- if ($RunTests) {
175
- Invoke-Step "Run tests" {
176
- ridk exec ruby -S bundle exec rake test
177
- }
178
- }
179
-
180
- if ($BuildGem) {
181
- Invoke-Step "Build local platform gem" {
182
- $rubyMinor = & ruby -e "print RUBY_VERSION[/\A\d+\.\d+/]"
183
- $dest = "lib\wreq_ruby\$rubyMinor"
184
- New-Item -ItemType Directory -Force $dest | Out-Null
185
- Copy-Item "lib\wreq_ruby\wreq_ruby.so" (Join-Path $dest "wreq_ruby.so") -Force
186
-
187
- ruby script/build_platform_gem.rb $platform
188
- }
189
- }
190
-
191
- if ($TestGem) {
192
- Invoke-Step "Install and smoke test platform gem" {
193
- $gem = Get-LatestPlatformGem
194
- $gemHome = Join-Path ([System.IO.Path]::GetTempPath()) "wreq-gem-test-$PID"
195
- $gemBin = Join-Path $gemHome "bin"
196
- $testDir = Join-Path ([System.IO.Path]::GetTempPath()) "wreq-gem-test-cwd-$PID"
197
-
198
- Remove-Item -Recurse -Force $gemHome, $testDir -ErrorAction SilentlyContinue
199
- New-Item -ItemType Directory -Force $gemHome, $gemBin, $testDir | Out-Null
200
-
201
- $oldGemHome = $env:GEM_HOME
202
- $oldGemPath = $env:GEM_PATH
203
- $oldGemrc = $env:GEMRC
204
- $oldRubyopt = $env:RUBYOPT
205
- $oldRubylib = $env:RUBYLIB
206
- $oldBundleGemfile = $env:BUNDLE_GEMFILE
207
- $oldBundleBinPath = $env:BUNDLE_BIN_PATH
208
- $oldBundlerVersion = $env:BUNDLER_VERSION
209
- $oldSmokeUrl = $env:WREQ_SMOKE_URL
210
- $oldWreqGemHome = $env:WREQ_GEM_HOME
211
-
212
- try {
213
- $env:GEM_HOME = $gemHome
214
- $env:GEM_PATH = $gemHome
215
- $env:GEMRC = ""
216
- $env:RUBYOPT = ""
217
- $env:RUBYLIB = ""
218
- $env:BUNDLE_GEMFILE = ""
219
- $env:BUNDLE_BIN_PATH = ""
220
- $env:BUNDLER_VERSION = ""
221
- $env:WREQ_SMOKE_URL = $SmokeUrl
222
- $env:WREQ_GEM_HOME = $gemHome
223
-
224
- gem install --norc --local --install-dir $gemHome --bindir $gemBin --no-document --force --no-user-install $gem.FullName
225
- if ($LASTEXITCODE -ne 0) {
226
- throw "Failed to install $($gem.FullName)."
227
- }
228
-
229
- Push-Location $testDir
230
- try {
231
- Invoke-RubySmoke "Load installed platform gem" @'
232
- STDOUT.sync = true
233
- STDERR.sync = true
234
- require "wreq"
235
- spec = Gem.loaded_specs.fetch("wreq")
236
- expected = File.expand_path(ENV.fetch("WREQ_GEM_HOME"))
237
- actual = File.expand_path(spec.full_gem_path)
238
- raise "loaded #{actual}, expected under #{expected}" unless actual.start_with?(expected)
239
- puts "loaded #{spec.full_name}"
240
- puts actual
241
- puts "wreq #{Wreq::VERSION}"
242
- '@
243
-
244
- Invoke-RubySmoke "Request through installed platform gem" @'
245
- STDOUT.sync = true
246
- STDERR.sync = true
247
- require "wreq"
248
- client = Wreq::Client.new
249
- resp = client.get(ENV.fetch("WREQ_SMOKE_URL"), timeout: 20)
250
- puts "HTTP #{resp.code}"
251
- raise "unexpected status #{resp.code}" unless resp.code == 200
252
- '@
253
- } finally {
254
- Pop-Location
255
- }
256
- } finally {
257
- $env:GEM_HOME = $oldGemHome
258
- $env:GEM_PATH = $oldGemPath
259
- $env:GEMRC = $oldGemrc
260
- $env:RUBYOPT = $oldRubyopt
261
- $env:RUBYLIB = $oldRubylib
262
- $env:BUNDLE_GEMFILE = $oldBundleGemfile
263
- $env:BUNDLE_BIN_PATH = $oldBundleBinPath
264
- $env:BUNDLER_VERSION = $oldBundlerVersion
265
- $env:WREQ_SMOKE_URL = $oldSmokeUrl
266
- $env:WREQ_GEM_HOME = $oldWreqGemHome
267
- Remove-Item -Recurse -Force $gemHome, $testDir -ErrorAction SilentlyContinue
268
- }
269
- }
270
- }