Skip to content

Commit 3c55295

Browse files
Update header.rs (#557)
1 parent 5504542 commit 3c55295

File tree

1 file changed

+2
-5
lines changed

1 file changed

+2
-5
lines changed

src/header.rs

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -288,11 +288,8 @@ impl OrigHeaderMap {
288288
// and we want to prevent Python's garbage collector from managing it.
289289
if let Some(init) = init {
290290
for name in init.iter() {
291-
let name = match name
292-
.extract::<PyBackedStr>()
293-
.map(|n| HeaderName::from_bytes(n.as_bytes()))
294-
{
295-
Ok(Ok(n)) => n,
291+
let name = match name.extract::<PyBackedStr>() {
292+
Ok(n) => Bytes::from_owner(n),
296293
_ => continue,
297294
};
298295

0 commit comments

Comments
 (0)