-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #4 from phnx-im/update-http
Update HTTP deps
- Loading branch information
Showing
6 changed files
with
89 additions
and
29 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,3 +6,5 @@ pub mod actix_middleware; | |
pub mod axum_middleware; | ||
pub mod memory_stores; | ||
pub mod state; | ||
|
||
pub mod utils; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
// SPDX-FileCopyrightText: 2024 Phoenix R&D GmbH <[email protected]> | ||
// | ||
// SPDX-License-Identifier: AGPL-3.0-or-later | ||
//! This module contains utility functions for converting between actix/reqwest | ||
//! and http types. This is necessary because actix/reqwest use a different http | ||
//! library to hyper. | ||
use std::str::FromStr; | ||
|
||
pub fn header_name_to_http10( | ||
header_name: actix_web::http::header::HeaderName, | ||
) -> http::header::HeaderName { | ||
http::header::HeaderName::from_str(header_name.as_str()).unwrap() | ||
} | ||
|
||
pub fn header_value_to_http10( | ||
header_value: actix_web::http::header::HeaderValue, | ||
) -> http::header::HeaderValue { | ||
http::header::HeaderValue::from_str(header_value.to_str().unwrap()).unwrap() | ||
} | ||
|
||
pub fn header_name_to_http02( | ||
header_name: http::header::HeaderName, | ||
) -> actix_web::http::header::HeaderName { | ||
actix_web::http::header::HeaderName::from_str(header_name.as_str()).unwrap() | ||
} | ||
|
||
pub fn header_value_to_http02( | ||
header_value: http::header::HeaderValue, | ||
) -> actix_web::http::header::HeaderValue { | ||
actix_web::http::header::HeaderValue::from_str(header_value.to_str().unwrap()).unwrap() | ||
} | ||
|
||
pub fn uri_to_http10(uri: &actix_web::http::Uri) -> http::Uri { | ||
http::Uri::from_str(uri.to_string().as_str()).unwrap() | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters