Skip to content

Commit 9a89aef

Browse files
authored
Merge pull request #113 from http-rs/fix-incorrect-comparison
Fix incorrect headervalues comparison
2 parents 5e97ccc + 7a2e213 commit 9a89aef

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/headers/header_values.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -85,25 +85,25 @@ impl Display for HeaderValues {
8585

8686
impl PartialEq<str> for HeaderValues {
8787
fn eq(&self, other: &str) -> bool {
88-
self.inner[0] == other
88+
self.inner.len() == 1 && self.inner[0] == other
8989
}
9090
}
9191

9292
impl<'a> PartialEq<&'a str> for HeaderValues {
9393
fn eq(&self, other: &&'a str) -> bool {
94-
&self.inner[0] == other
94+
self.inner.len() == 1 && &self.inner[0] == other
9595
}
9696
}
9797

9898
impl PartialEq<String> for HeaderValues {
9999
fn eq(&self, other: &String) -> bool {
100-
&self.inner[0] == other
100+
self.inner.len() == 1 && &self.inner[0] == other
101101
}
102102
}
103103

104104
impl<'a> PartialEq<&String> for HeaderValues {
105105
fn eq(&self, other: &&String) -> bool {
106-
&&self.inner[0] == other
106+
self.inner.len() == 1 && &&self.inner[0] == other
107107
}
108108
}
109109

0 commit comments

Comments
 (0)