File: 2003_no_net.patch

package info (click to toggle)
rust-ureq 3.0.11%2B~0.4.1-3
  • links: PTS, VCS
  • area: main
  • in suites: trixie
  • size: 1,740 kB
  • sloc: sh: 23; makefile: 13
file content (727 lines) | stat: -rw-r--r-- 17,767 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
Description: skip network-requiring tests by default
Author: Jonas Smedegaard <dr@jones.dk>
Forwarded: not-needed
Last-Update: 2025-02-09
---
This patch header follows DEP-3: http://dep.debian.net/deps/dep3/
--- a/src/error.rs
+++ b/src/error.rs
@@ -327,6 +327,7 @@
     use super::*;
 
     #[test]
+    #[ignore]
     #[cfg(feature = "_test")]
     fn status_code_error_redirect() {
         use crate::test::init_test_log;
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -36,7 +36,7 @@
 //!
 //! In its simplest form, ureq looks like this:
 //!
-//! ```rust
+//! ```rust,no_run
 //! let body: String = ureq::get("http://example.com")
 //!     .header("Example-Header", "header value")
 //!     .call()?
@@ -51,7 +51,7 @@
 //! [`Arc`] and all clones of an Agent share state among each other. Creating
 //! an Agent also allows setting options like the TLS configuration.
 //!
-//! ```rust
+//! ```rust,no_run
 //! # fn no_run() -> Result<(), ureq::Error> {
 //! use ureq::Agent;
 //! use std::time::Duration;
@@ -80,7 +80,7 @@
 //!
 //! Ureq supports sending and receiving json, if you enable the **json** feature:
 //!
-//! ```rust
+//! ```rust,no_run
 //! # #[cfg(feature = "json")]
 //! # fn no_run() -> Result<(), ureq::Error> {
 //! use serde::{Serialize, Deserialize};
@@ -114,7 +114,7 @@
 //!
 //! This behavior can be turned off via [`http_status_as_error()`]
 //!
-//! ```rust
+//! ```rust,no_run
 //! use ureq::Error;
 //!
 //! # fn no_run() -> Result<(), ureq::Error> {
@@ -177,7 +177,7 @@
 //! ureq does not guarantee to default to ring indefinitely. `rustls` as a feature flag will always
 //! work, but the specific crypto backend might change in a minor version.
 //!
-//! ```
+//! ```no_run
 //! # #[cfg(feature = "rustls")]
 //! # {
 //! // This uses rustls
@@ -203,7 +203,7 @@
 //! up as a default or used by the crate level convenience calls (`ureq::get` etc) – it
 //! must be configured on the agent.
 //!
-//! ```
+//! ```no_run
 //! # #[cfg(feature = "native-tls")]
 //! # {
 //! use ureq::config::Config;
@@ -247,7 +247,7 @@
 //! To use this verifier, you need to enable it using feature flag **platform-verifier** as well as
 //! configure an agent to use it.
 //!
-//! ```
+//! ```no_run
 //! # #[cfg(all(feature = "rustls", feature="platform-verifier"))]
 //! # {
 //! use ureq::Agent;
@@ -345,7 +345,7 @@
 //! sending the body, ureq will respect that header by not overriding it,
 //! and by encoding the body or not, as indicated by the headers you set.
 //!
-//! ```
+//! ```no_run
 //! let resp = ureq::put("https://httpbin.org/put")
 //!     .header("Transfer-Encoding", "chunked")
 //!     .send("Hello world")?;
@@ -388,7 +388,7 @@
 //!
 //! ## Example using HTTP
 //!
-//! ```rust
+//! ```rust,no_run
 //! use ureq::{Agent, Proxy};
 //! # fn no_run() -> std::result::Result<(), ureq::Error> {
 //! // Configure an http connect proxy.
@@ -406,7 +406,7 @@
 //!
 //! ## Example using SOCKS5
 //!
-//! ```rust
+//! ```rust,no_run
 //! use ureq::{Agent, Proxy};
 //! # #[cfg(feature = "socks-proxy")]
 //! # fn no_run() -> std::result::Result<(), ureq::Error> {
@@ -710,6 +710,7 @@
     }
 
     #[test]
+    #[ignore]
     fn connect_http_google() {
         init_test_log();
         let agent = Agent::new_with_defaults();
@@ -728,6 +729,7 @@
     }
 
     #[test]
+    #[ignore]
     #[cfg(feature = "rustls")]
     fn connect_https_google_rustls() {
         init_test_log();
@@ -754,6 +756,7 @@
     }
 
     #[test]
+    #[ignore]
     #[cfg(feature = "native-tls")]
     fn connect_https_google_native_tls_simple() {
         init_test_log();
@@ -828,6 +831,7 @@
     }
 
     #[test]
+    #[ignore]
     #[cfg(feature = "rustls")]
     fn connect_https_google_noverif() {
         init_test_log();
@@ -857,6 +861,7 @@
     }
 
     #[test]
+    #[ignore]
     fn simple_put_content_len() {
         init_test_log();
         let mut res = put("http://httpbin.org/put").send(&[0_u8; 100]).unwrap();
@@ -864,6 +869,7 @@
     }
 
     #[test]
+    #[ignore]
     fn simple_put_chunked() {
         init_test_log();
         let mut res = put("http://httpbin.org/put")
@@ -875,6 +881,7 @@
     }
 
     #[test]
+    #[ignore]
     fn simple_get() {
         init_test_log();
         let mut res = get("http://httpbin.org/get").call().unwrap();
@@ -882,6 +889,7 @@
     }
 
     #[test]
+    #[ignore]
     fn simple_head() {
         init_test_log();
         let mut res = head("http://httpbin.org/get").call().unwrap();
@@ -889,6 +897,7 @@
     }
 
     #[test]
+    #[ignore]
     fn redirect_no_follow() {
         init_test_log();
         let agent: Agent = Config::builder().max_redirects(0).build().into();
@@ -904,6 +913,7 @@
     }
 
     #[test]
+    #[ignore]
     fn redirect_max_with_error() {
         init_test_log();
         let agent: Agent = Config::builder().max_redirects(3).build().into();
@@ -918,6 +928,7 @@
     }
 
     #[test]
+    #[ignore]
     fn redirect_max_without_error() {
         init_test_log();
         let agent: Agent = Config::builder()
@@ -936,6 +947,7 @@
     }
 
     #[test]
+    #[ignore]
     fn redirect_follow() {
         init_test_log();
         let res = get("http://httpbin.org/redirect-to?url=%2Fget")
@@ -946,6 +958,7 @@
     }
 
     #[test]
+    #[ignore]
     fn redirect_history_none() {
         init_test_log();
         let res = get("http://httpbin.org/redirect-to?url=%2Fget")
@@ -956,6 +969,7 @@
     }
 
     #[test]
+    #[ignore]
     fn redirect_history_some() {
         init_test_log();
         let agent: Agent = Config::builder()
@@ -1005,6 +1019,7 @@
     }
 
     #[test]
+    #[ignore]
     fn connect_https_invalid_name() {
         let result = get("https://example.com{REQUEST_URI}/").call();
         let err = result.unwrap_err();
@@ -1013,6 +1028,7 @@
     }
 
     #[test]
+    #[ignore]
     fn post_big_body_chunked() {
         // https://github.com/algesten/ureq/issues/879
         let mut data = io::Cursor::new(vec![42; 153_600]);
@@ -1023,6 +1039,7 @@
     }
 
     #[test]
+    #[ignore]
     #[cfg(not(feature = "_test"))]
     fn username_password_from_uri() {
         init_test_log();
@@ -1032,6 +1049,7 @@
     }
 
     #[test]
+    #[ignore]
     #[cfg(all(feature = "cookies", feature = "_test"))]
     fn store_response_cookies() {
         let agent = Agent::new_with_defaults();
@@ -1049,6 +1067,7 @@
     }
 
     #[test]
+    #[ignore]
     #[cfg(all(feature = "cookies", feature = "_test"))]
     fn send_request_cookies() {
         init_test_log();
@@ -1071,6 +1090,7 @@
     }
 
     #[test]
+    #[ignore]
     #[cfg(all(feature = "_test", not(feature = "cookies")))]
     fn partial_redirect_when_following() {
         init_test_log();
@@ -1079,6 +1099,7 @@
     }
 
     #[test]
+    #[ignore]
     #[cfg(feature = "_test")]
     fn partial_redirect_when_not_following() {
         init_test_log();
@@ -1093,6 +1114,7 @@
     }
 
     #[test]
+    #[ignore]
     #[cfg(feature = "_test")]
     fn http_connect_proxy() {
         init_test_log();
@@ -1133,6 +1155,7 @@
     }
 
     #[test]
+    #[ignore]
     fn limit_max_response_header_size() {
         init_test_log();
         let err = get("http://httpbin.org/get")
@@ -1145,6 +1168,7 @@
     }
 
     #[test]
+    #[ignore]
     fn propfind_with_body() {
         init_test_log();
 
@@ -1164,6 +1188,7 @@
     }
 
     #[test]
+    #[ignore]
     #[cfg(feature = "_test")]
     fn non_standard_method() {
         init_test_log();
--- a/src/agent.rs
+++ b/src/agent.rs
@@ -163,7 +163,7 @@
     /// all clones of the same [`Agent`], meaning you must drop the CookieJar
     /// before using the agent, or end up with a deadlock.
     ///
-    /// ```rust
+    /// ```rust,no_run
     /// # #[cfg(feature = "json")]
     /// # fn no_run() -> Result<(), ureq::Error> {
     /// use std::io::Write;
@@ -197,7 +197,7 @@
     ///
     /// # Example
     ///
-    /// ```
+    /// ```no_run
     /// use ureq::{http, Agent};
     ///
     /// let agent: Agent = Agent::new_with_defaults();
--- a/src/request.rs
+++ b/src/request.rs
@@ -59,7 +59,7 @@
     ///
     /// # Examples
     ///
-    /// ```
+    /// ```no_run
     /// use ureq::http::Method;
     ///
     /// let req = ureq::get("http://httpbin.org/get");
@@ -79,7 +79,7 @@
     ///
     /// # Examples
     ///
-    /// ```
+    /// ```no_run
     /// let req = ureq::get("https://httpbin.org/get")
     ///     .header("X-Custom-Foo", "bar");
     /// ```
@@ -100,7 +100,7 @@
     ///
     /// # Example
     ///
-    /// ```
+    /// ```no_run
     /// let req = ureq::get("http://httpbin.org/get")
     ///     .header("Accept", "text/html")
     ///     .header("X-Custom-Foo", "bar");
@@ -118,7 +118,7 @@
     ///
     /// # Example
     ///
-    /// ```
+    /// ```no_run
     /// # use ureq::http::header::HeaderValue;
     /// let mut req =  ureq::get("http://httpbin.org/get");
     /// {
@@ -142,7 +142,7 @@
     ///
     /// # Examples
     ///
-    /// ```
+    /// ```no_run
     /// // Creates a URL with an encoded query parameter:
     /// // https://httpbin.org/get?my_query=with%20value
     /// let req = ureq::get("https://httpbin.org/get")
@@ -193,7 +193,7 @@
     ///
     /// For example, to set `?format=json&dest=%2Flogin`
     ///
-    /// ```
+    /// ```no_run
     /// let query = vec![
     ///     ("format", "json"),
     ///     ("dest", "/login"),
@@ -228,7 +228,7 @@
     ///
     /// For example, to set `?format=json&dest=/login` without encoding:
     ///
-    /// ```
+    /// ```no_run
     /// let query = vec![
     ///     ("format", "json"),
     ///     ("dest", "/login"),
@@ -258,7 +258,7 @@
     ///
     /// # Examples
     ///
-    /// ```
+    /// ```no_run
     /// let req = ureq::get("https://www.google.com/")
     ///     .uri("https://httpbin.org/get");
     /// ```
@@ -277,7 +277,7 @@
     ///
     /// # Examples
     ///
-    /// ```
+    /// ```no_run
     /// let req = ureq::get("http://httpbin.org/get");
     /// assert_eq!(req.uri_ref().unwrap(), "http://httpbin.org/get");
     /// ```
@@ -292,7 +292,7 @@
     ///
     /// # Examples
     ///
-    /// ```
+    /// ```no_run
     /// use ureq::http::Version;
     ///
     /// let req = ureq::get("https://www.google.com/")
@@ -309,7 +309,7 @@
     ///
     /// # Examples
     ///
-    /// ```
+    /// ```no_run
     /// use ureq::http::Version;
     ///
     /// let req = ureq::get("http://httpbin.org/get");
@@ -325,7 +325,7 @@
     ///
     /// # Example
     ///
-    /// ```
+    /// ```no_run
     /// use ureq::Agent;
     ///
     /// let agent: Agent = Agent::config_builder()
@@ -354,7 +354,7 @@
     ///
     /// # Examples
     ///
-    /// ```
+    /// ```no_run
     /// let req = ureq::get("http://httpbin.org/get")
     ///     .extension("My Extension");
     ///
@@ -375,7 +375,7 @@
     ///
     /// # Example
     ///
-    /// ```
+    /// ```no_run
     /// let req = ureq::get("http://httpbin.org/get")
     ///     .extension("My Extension").extension(5u32);
     /// let extensions = req.extensions_ref().unwrap();
@@ -392,7 +392,7 @@
     ///
     /// # Example
     ///
-    /// ```
+    /// ```no_run
     /// let mut req = ureq::get("http://httpbin.org/get");
     /// let mut extensions = req.extensions_mut().unwrap();
     /// extensions.insert(5u32);
@@ -442,7 +442,7 @@
     ///
     /// It sends neither `Content-Length` nor `Transfer-Encoding`.
     ///
-    /// ```
+    /// ```no_run
     /// let res = ureq::get("http://httpbin.org/get")
     ///     .call()?;
     /// # Ok::<_, ureq::Error>(())
@@ -462,7 +462,7 @@
     ///
     /// Example using DELETE while sending a body.
     ///
-    /// ```
+    /// ```no_run
     /// let res = ureq::delete("http://httpbin.org/delete")
     ///     // this "unlocks" send() below
     ///     .force_send_body()
@@ -504,7 +504,7 @@
 
     /// Set the content-type header.
     ///
-    /// ```
+    /// ```no_run
     /// let res = ureq::post("http://httpbin.org/post")
     ///     .content_type("text/html; charset=utf-8")
     ///     .send("<html><body>åäö</body></html>")?;
@@ -521,7 +521,7 @@
 
     /// Send body data and blocks the caller until we receive response.
     ///
-    /// ```
+    /// ```no_run
     /// let res = ureq::post("http://httpbin.org/post")
     ///     .send(&[0_u8; 1000])?;
     /// # Ok::<_, ureq::Error>(())
@@ -540,7 +540,7 @@
     ///
     /// This is equivalent to `.send(&[])`.
     ///
-    /// ```
+    /// ```no_run
     /// let res = ureq::post("http://httpbin.org/post")
     ///     .send_empty()?;
     /// # Ok::<_, ureq::Error>(())
@@ -554,7 +554,7 @@
     /// Constructs a [form submission] with the content-type header
     /// `application/x-www-form-urlencoded`. Keys and values will be URL encoded.
     ///
-    /// ```
+    /// ```no_run
     /// let form = [
     ///     ("name", "martin"),
     ///     ("favorite_bird", "blue-footed booby"),
@@ -606,7 +606,7 @@
     /// to a string before sending (does allocate). Will set the content-type header
     /// `application/json`.
     ///
-    /// ```
+    /// ```no_run
     /// use serde::Serialize;
     ///
     /// #[derive(Serialize)]
--- a/src/response.rs
+++ b/src/response.rs
@@ -18,7 +18,7 @@
     ///
     /// This can differ from the request uri when we have followed redirects.
     ///
-    /// ```
+    /// ```no_run
     /// use ureq::ResponseExt;
     ///
     /// let res = ureq::get("https://httpbin.org/redirect-to?url=%2Fget")
@@ -34,7 +34,7 @@
     /// is `false`.
     ///
     ///
-    /// ```
+    /// ```no_run
     /// # use ureq::http::Uri;
     /// use ureq::ResponseExt;
     ///
--- a/src/body/mod.rs
+++ b/src/body/mod.rs
@@ -57,7 +57,7 @@
 ///
 /// # Example
 ///
-/// ```
+/// ```no_run
 /// use std::io::Read;
 /// let mut res = ureq::get("http://httpbin.org/bytes/100")
 ///     .call()?;
@@ -122,7 +122,7 @@
     ///
     /// # Example
     ///
-    /// ```
+    /// ```no_run
     /// let res = ureq::get("https://www.google.com/")
     ///     .call()?;
     ///
@@ -146,7 +146,7 @@
     ///
     /// # Example
     ///
-    /// ```
+    /// ```no_run
     /// let res = ureq::get("https://www.google.com/")
     ///     .call()?;
     ///
@@ -169,7 +169,7 @@
     ///
     /// # Example
     ///
-    /// ```
+    /// ```no_run
     /// let res = ureq::get("https://httpbin.org/bytes/100")
     ///     .call()?;
     ///
@@ -195,7 +195,7 @@
     ///
     /// # Example
     ///
-    /// ```
+    /// ```no_run
     /// use std::io::Read;
     ///
     /// let mut res = ureq::get("http://httpbin.org/bytes/100")
@@ -219,7 +219,7 @@
     ///
     /// * Reader is not limited. To set a limit use [`Body::into_with_config()`].
     ///
-    /// ```
+    /// ```no_run
     /// use std::io::Read;
     ///
     /// let res = ureq::get("http://httpbin.org/bytes/100")
@@ -243,7 +243,7 @@
     ///
     /// To change these defaults use [`Body::with_config()`].
     ///
-    /// ```
+    /// ```no_run
     /// let mut res = ureq::get("http://httpbin.org/robots.txt")
     ///     .call()?;
     ///
@@ -263,7 +263,7 @@
     /// * Response is limited to 10MB.
     ///
     /// To change this default use [`Body::with_config()`].
-    /// ```
+    /// ```no_run
     /// let mut res = ureq::get("http://httpbin.org/bytes/100")
     ///     .call()?;
     ///
@@ -322,7 +322,7 @@
     ///
     /// # Example
     ///
-    /// ```
+    /// ```no_run
     /// let reader = ureq::get("http://httpbin.org/bytes/100")
     ///     .call()?
     ///     .body_mut()
@@ -343,7 +343,7 @@
     ///
     /// # Example
     ///
-    /// ```
+    /// ```no_run
     /// // Get the body out of http::Response
     /// let (_, body) = ureq::get("http://httpbin.org/bytes/100")
     ///     .call()?
@@ -424,7 +424,7 @@
     ///
     /// # Example of owned vs shared
     ///
-    /// ```
+    /// ```no_run
     /// // Creates an owned reader.
     /// let reader = ureq::get("https://httpbin.org/get")
     ///     .call()?
@@ -436,7 +436,7 @@
     /// # Ok::<_, ureq::Error>(())
     /// ```
     ///
-    /// ```
+    /// ```no_run
     /// // Creates a shared reader.
     /// let reader = ureq::get("https://httpbin.org/get")
     ///     .call()?
@@ -458,7 +458,7 @@
     ///
     /// # Example
     ///
-    /// ```
+    /// ```no_run
     /// // Reads max 10k to a String.
     /// let string = ureq::get("https://httpbin.org/get")
     ///     .call()?
@@ -484,7 +484,7 @@
     ///
     /// # Example
     ///
-    /// ```
+    /// ```no_run
     /// // Reads max 10k to a Vec.
     /// let myvec = ureq::get("https://httpbin.org/get")
     ///     .call()?
@@ -613,7 +613,7 @@
 ///
 /// # Example
 ///
-/// ```
+/// ```no_run
 /// use std::io::Read;
 /// let mut res = ureq::get("http://httpbin.org/bytes/100")
 ///     .call()?;
--- a/src/send_body.rs
+++ b/src/send_body.rs
@@ -151,7 +151,7 @@
 ///
 /// These two examples are equivalent.
 ///
-/// ```
+/// ```no_run
 /// let data: &[u8] = b"My special request body data";
 ///
 /// let response = ureq::post("https://httpbin.org/post")
@@ -161,7 +161,7 @@
 ///
 /// Using `http` crate API
 ///
-/// ```
+/// ```no_run
 /// use ureq::http;
 ///
 /// let data: &[u8] = b"My special request body data";
--- a/src/unversioned/transport/mod.rs
+++ b/src/unversioned/transport/mod.rs
@@ -94,7 +94,7 @@
 ///
 /// # Example
 ///
-/// ```
+/// ```no_run
 /// # #[cfg(all(feature = "rustls", not(feature = "_test")))] {
 /// use ureq::{Agent, config::Config};
 ///
--- a/src/middleware.rs
+++ b/src/middleware.rs
@@ -116,7 +116,7 @@
 /// This example shows how we can increase a counter for each request going
 /// through the agent.
 ///
-/// ```
+/// ```no_run
 /// use ureq::{Body, SendBody, Agent, config::Config};
 /// use ureq::middleware::{Middleware, MiddlewareNext};
 /// use ureq::http::{Request, Response};