• Home
  • Raw
  • Download

Lines Matching full:headers

6     let mut headers = HeaderMap::new();  in smoke()  localVariable
8 assert!(headers.get("hello").is_none()); in smoke()
12 match headers.entry(&name) { in smoke()
19 assert!(headers.get("hello").is_some()); in smoke()
21 match headers.entry(&name) { in smoke()
42 let mut headers = HeaderMap::<u32>::with_capacity(32); in reserve_over_capacity() localVariable
43 headers.reserve(50_000); // over MAX_SIZE in reserve_over_capacity()
62 let mut headers = HeaderMap::<u32>::with_capacity(0); in reserve_overflow() localVariable
63 headers.reserve(std::usize::MAX); // next_power_of_two overflows in reserve_overflow()
68 let mut headers = HeaderMap::new(); in drain() localVariable
72 headers.insert(name, "world".parse().unwrap()); in drain()
75 let mut iter = headers.drain(); in drain()
84 assert!(headers.is_empty()); in drain()
87 headers.insert( in drain()
91 headers.insert( in drain()
95 headers.append( in drain()
102 let mut iter = headers.drain(); in drain()
124 let mut headers = HeaderMap::new(); in drain_drop_immediately() localVariable
125 headers.insert("hello", "world".parse().unwrap()); in drain_drop_immediately()
126 headers.insert("zomg", "bar".parse().unwrap()); in drain_drop_immediately()
127 headers.append("hello", "world2".parse().unwrap()); in drain_drop_immediately()
129 let iter = headers.drain(); in drain_drop_immediately()
138 let mut headers = HeaderMap::<HeaderValue>::new(); in drain_forget() localVariable
139 headers.insert("hello", "world".parse().unwrap()); in drain_forget()
140 headers.insert("zomg", "bar".parse().unwrap()); in drain_forget()
142 assert_eq!(headers.len(), 2); in drain_forget()
145 let mut iter = headers.drain(); in drain_forget()
151 assert_eq!(headers.len(), 0); in drain_forget()
156 let mut headers = HeaderMap::new(); in drain_entry() localVariable
158 headers.insert( in drain_entry()
162 headers.insert( in drain_entry()
166 headers.append( in drain_entry()
170 headers.insert( in drain_entry()
174 headers.append( in drain_entry()
178 assert_eq!(5, headers.len()); in drain_entry()
182 let mut e = match headers.entry("hello") { in drain_entry()
193 assert_eq!(5-2+1, headers.len()); in drain_entry()
410 let mut headers = HeaderMap::new(); in get_invalid() localVariable
411 headers.insert("foo", "bar".parse().unwrap()); in get_invalid()
412 assert!(headers.get("Evil\r\nKey").is_none()); in get_invalid()
418 let mut headers = HeaderMap::new(); in insert_invalid() localVariable
419 headers.insert("evil\r\nfoo", "bar".parse().unwrap()); in insert_invalid()
433 let mut headers = HeaderMap::new(); in remove_multiple_a() localVariable
434 headers.insert(VIA, "1.1 example.com".parse().unwrap()); in remove_multiple_a()
435 headers.insert(SET_COOKIE, "cookie_1=value 1".parse().unwrap()); in remove_multiple_a()
436 headers.append(SET_COOKIE, "cookie_2=value 2".parse().unwrap()); in remove_multiple_a()
437 headers.append(VIA, "1.1 other.com".parse().unwrap()); in remove_multiple_a()
438 headers.append(SET_COOKIE, "cookie_3=value 3".parse().unwrap()); in remove_multiple_a()
439 headers.insert(VARY, "*".parse().unwrap()); in remove_multiple_a()
441 assert_eq!(headers.len(), 6); in remove_multiple_a()
443 let cookie = headers.remove(SET_COOKIE); in remove_multiple_a()
445 assert_eq!(headers.len(), 3); in remove_multiple_a()
447 let via = headers.remove(VIA); in remove_multiple_a()
449 assert_eq!(headers.len(), 1); in remove_multiple_a()
451 let vary = headers.remove(VARY); in remove_multiple_a()
453 assert_eq!(headers.len(), 0); in remove_multiple_a()
458 let mut headers = HeaderMap::new(); in remove_multiple_b() localVariable
459 headers.insert(VIA, "1.1 example.com".parse().unwrap()); in remove_multiple_b()
460 headers.insert(SET_COOKIE, "cookie_1=value 1".parse().unwrap()); in remove_multiple_b()
461 headers.append(SET_COOKIE, "cookie_2=value 2".parse().unwrap()); in remove_multiple_b()
462 headers.append(VIA, "1.1 other.com".parse().unwrap()); in remove_multiple_b()
463 headers.append(SET_COOKIE, "cookie_3=value 3".parse().unwrap()); in remove_multiple_b()
464 headers.insert(VARY, "*".parse().unwrap()); in remove_multiple_b()
466 assert_eq!(headers.len(), 6); in remove_multiple_b()
468 let vary = headers.remove(VARY); in remove_multiple_b()
470 assert_eq!(headers.len(), 5); in remove_multiple_b()
472 let via = headers.remove(VIA); in remove_multiple_b()
474 assert_eq!(headers.len(), 3); in remove_multiple_b()
476 let cookie = headers.remove(SET_COOKIE); in remove_multiple_b()
478 assert_eq!(headers.len(), 0); in remove_multiple_b()
483 let mut headers = HeaderMap::new(); in remove_entry_multi_0() localVariable
484 let cookies = remove_all_values(&mut headers, SET_COOKIE); in remove_entry_multi_0()
486 assert_eq!(headers.len(), 0); in remove_entry_multi_0()
491 let mut headers = HeaderMap::new(); in remove_entry_multi_0_others() localVariable
492 headers.insert(VIA, "1.1 example.com".parse().unwrap()); in remove_entry_multi_0_others()
493 headers.append(VIA, "1.1 other.com".parse().unwrap()); in remove_entry_multi_0_others()
495 let cookies = remove_all_values(&mut headers, SET_COOKIE); in remove_entry_multi_0_others()
497 assert_eq!(headers.len(), 2); in remove_entry_multi_0_others()
502 let mut headers = HeaderMap::new(); in remove_entry_multi_1() localVariable
503 headers.insert(SET_COOKIE, "cookie_1=value 1".parse().unwrap()); in remove_entry_multi_1()
505 let cookies = remove_all_values(&mut headers, SET_COOKIE); in remove_entry_multi_1()
507 assert_eq!(headers.len(), 0); in remove_entry_multi_1()
512 let mut headers = HeaderMap::new(); in remove_entry_multi_1_other() localVariable
513 headers.insert(SET_COOKIE, "cookie_1=value 1".parse().unwrap()); in remove_entry_multi_1_other()
514 headers.insert(VIA, "1.1 example.com".parse().unwrap()); in remove_entry_multi_1_other()
516 let cookies = remove_all_values(&mut headers, SET_COOKIE); in remove_entry_multi_1_other()
518 assert_eq!(headers.len(), 1); in remove_entry_multi_1_other()
520 let vias = remove_all_values(&mut headers, VIA); in remove_entry_multi_1_other()
522 assert_eq!(headers.len(), 0); in remove_entry_multi_1_other()
528 let mut headers = HeaderMap::new(); in remove_entry_multi_2() localVariable
529 headers.insert(SET_COOKIE, "cookie_1=value 1".parse().unwrap()); in remove_entry_multi_2()
530 headers.append(SET_COOKIE, "cookie_2=value 2".parse().unwrap()); in remove_entry_multi_2()
532 let cookies = remove_all_values(&mut headers, SET_COOKIE); in remove_entry_multi_2()
534 assert_eq!(headers.len(), 0); in remove_entry_multi_2()
539 let mut headers = HeaderMap::new(); in remove_entry_multi_3() localVariable
540 headers.insert(SET_COOKIE, "cookie_1=value 1".parse().unwrap()); in remove_entry_multi_3()
541 headers.append(SET_COOKIE, "cookie_2=value 2".parse().unwrap()); in remove_entry_multi_3()
542 headers.append(SET_COOKIE, "cookie_3=value 3".parse().unwrap()); in remove_entry_multi_3()
544 let cookies = remove_all_values(&mut headers, SET_COOKIE); in remove_entry_multi_3()
546 assert_eq!(headers.len(), 0); in remove_entry_multi_3()
551 let mut headers = HeaderMap::new(); in remove_entry_multi_3_others() localVariable
552 headers.insert(VIA, "1.1 example.com".parse().unwrap()); in remove_entry_multi_3_others()
553 headers.insert(SET_COOKIE, "cookie_1=value 1".parse().unwrap()); in remove_entry_multi_3_others()
554 headers.append(SET_COOKIE, "cookie_2=value 2".parse().unwrap()); in remove_entry_multi_3_others()
555 headers.append(VIA, "1.1 other.com".parse().unwrap()); in remove_entry_multi_3_others()
556 headers.append(SET_COOKIE, "cookie_3=value 3".parse().unwrap()); in remove_entry_multi_3_others()
557 headers.insert(VARY, "*".parse().unwrap()); in remove_entry_multi_3_others()
559 let cookies = remove_all_values(&mut headers, SET_COOKIE); in remove_entry_multi_3_others()
561 assert_eq!(headers.len(), 3); in remove_entry_multi_3_others()
563 let vias = remove_all_values(&mut headers, VIA); in remove_entry_multi_3_others()
565 assert_eq!(headers.len(), 1); in remove_entry_multi_3_others()
567 let varies = remove_all_values(&mut headers, VARY); in remove_entry_multi_3_others()
569 assert_eq!(headers.len(), 0); in remove_entry_multi_3_others()
572 fn remove_all_values<K>(headers: &mut HeaderMap, key: K) -> Vec<HeaderValue> in remove_all_values()
575 match headers.entry(key) { in remove_all_values()
583 let mut headers = HeaderMap::new(); in remove_entry_3_others_a() localVariable
584 headers.insert(VIA, "1.1 example.com".parse().unwrap()); in remove_entry_3_others_a()
585 headers.insert(SET_COOKIE, "cookie_1=value 1".parse().unwrap()); in remove_entry_3_others_a()
586 headers.append(SET_COOKIE, "cookie_2=value 2".parse().unwrap()); in remove_entry_3_others_a()
587 headers.append(VIA, "1.1 other.com".parse().unwrap()); in remove_entry_3_others_a()
588 headers.append(SET_COOKIE, "cookie_3=value 3".parse().unwrap()); in remove_entry_3_others_a()
589 headers.insert(VARY, "*".parse().unwrap()); in remove_entry_3_others_a()
591 assert_eq!(headers.len(), 6); in remove_entry_3_others_a()
593 let cookie = remove_values(&mut headers, SET_COOKIE); in remove_entry_3_others_a()
595 assert_eq!(headers.len(), 3); in remove_entry_3_others_a()
597 let via = remove_values(&mut headers, VIA); in remove_entry_3_others_a()
599 assert_eq!(headers.len(), 1); in remove_entry_3_others_a()
601 let vary = remove_values(&mut headers, VARY); in remove_entry_3_others_a()
603 assert_eq!(headers.len(), 0); in remove_entry_3_others_a()
608 let mut headers = HeaderMap::new(); in remove_entry_3_others_b() localVariable
609 headers.insert(VIA, "1.1 example.com".parse().unwrap()); in remove_entry_3_others_b()
610 headers.insert(SET_COOKIE, "cookie_1=value 1".parse().unwrap()); in remove_entry_3_others_b()
611 headers.append(SET_COOKIE, "cookie_2=value 2".parse().unwrap()); in remove_entry_3_others_b()
612 headers.append(VIA, "1.1 other.com".parse().unwrap()); in remove_entry_3_others_b()
613 headers.append(SET_COOKIE, "cookie_3=value 3".parse().unwrap()); in remove_entry_3_others_b()
614 headers.insert(VARY, "*".parse().unwrap()); in remove_entry_3_others_b()
616 assert_eq!(headers.len(), 6); in remove_entry_3_others_b()
618 let vary = remove_values(&mut headers, VARY); in remove_entry_3_others_b()
620 assert_eq!(headers.len(), 5); in remove_entry_3_others_b()
622 let via = remove_values(&mut headers, VIA); in remove_entry_3_others_b()
624 assert_eq!(headers.len(), 3); in remove_entry_3_others_b()
626 let cookie = remove_values(&mut headers, SET_COOKIE); in remove_entry_3_others_b()
628 assert_eq!(headers.len(), 0); in remove_entry_3_others_b()
631 fn remove_values<K>(headers: &mut HeaderMap, key: K) -> Option<HeaderValue> in remove_values()
634 match headers.entry(key) { in remove_values()