From 511026cab01136d6e94f8fb234b66889b5cf27ef Mon Sep 17 00:00:00 2001 From: Sven-Hendrik Haase Date: Mon, 29 Jul 2019 06:11:23 +0200 Subject: [PATCH] Allow HeaderMap to be cloned (#1014) * Allow HeaderMap to be cloned * Add entry to changelog --- actix-http/CHANGES.md | 4 ++++ actix-http/src/header/map.rs | 4 ++-- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/actix-http/CHANGES.md b/actix-http/CHANGES.md index 4b53161ae..cffdd7af1 100644 --- a/actix-http/CHANGES.md +++ b/actix-http/CHANGES.md @@ -2,6 +2,10 @@ ## [0.2.8] - 2019-07-xx +### Changed + +* Add `Clone` impl for `HeaderMap` + ### Fixed * Invalid response with compression middleware enabled, but compression-related features disabled #997 diff --git a/actix-http/src/header/map.rs b/actix-http/src/header/map.rs index 694aed02a..f2f1ba51c 100644 --- a/actix-http/src/header/map.rs +++ b/actix-http/src/header/map.rs @@ -9,12 +9,12 @@ use http::HttpTryFrom; /// `HeaderMap` is an multimap of [`HeaderName`] to values. /// /// [`HeaderName`]: struct.HeaderName.html -#[derive(Debug)] +#[derive(Debug, Clone)] pub struct HeaderMap { pub(crate) inner: HashMap, } -#[derive(Debug)] +#[derive(Debug, Clone)] pub(crate) enum Value { One(HeaderValue), Multi(Vec),