Skip to content

Commit

Permalink
[#201] 테스트 깨진거 수정
Browse files Browse the repository at this point in the history
  • Loading branch information
myyrakle committed Dec 24, 2024
1 parent 1179651 commit f90b1c5
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions rupring/src/response.rs
Original file line number Diff line number Diff line change
Expand Up @@ -254,7 +254,7 @@ impl Response {
/// ```
/// use rupring::HeaderName;
/// let response = rupring::Response::new().header("content-type", "application/json".to_string());
/// assert_eq!(response.headers.get(&HeaderName::from_static("content-type")).unwrap(), &"application/json".to_string());
/// assert_eq!(response.headers.get(&HeaderName::from_static("content-type")).unwrap(), &vec!["application/json".to_string()]);
pub fn header(mut self, name: &'static str, value: impl ToString) -> Self {
if let Some(values) = self.headers.get_mut(&HeaderName::from_static(name)) {
values.push(value.to_string());
Expand All @@ -271,9 +271,9 @@ impl Response {
/// use rupring::HeaderName;
/// use std::collections::HashMap;
/// let mut headers = HashMap::new();
/// headers.insert(HeaderName::from_static("content-type"), "application/json".to_string());
/// headers.insert(HeaderName::from_static("content-type"), vec!["application/json".to_string()]);
/// let response = rupring::Response::new().headers(headers);
/// assert_eq!(response.headers.get(&HeaderName::from_static("content-type")).unwrap(), &"application/json".to_string());
/// assert_eq!(response.headers.get(&HeaderName::from_static("content-type")).unwrap(), &vec!["application/json".to_string()]);
pub fn headers(mut self, headers: HashMap<HeaderName, Vec<String>>) -> Self {
self.headers = headers;
return self;
Expand All @@ -284,7 +284,7 @@ impl Response {
/// use rupring::HeaderName;
/// use std::collections::HashMap;
/// let response = rupring::Response::new().redirect("https://naver.com");
/// assert_eq!(response.headers.get(&HeaderName::from_static("location")).unwrap(), &"https://naver.com".to_string());
/// assert_eq!(response.headers.get(&HeaderName::from_static("location")).unwrap(), &vec!["https://naver.com".to_string()]);
pub fn redirect(mut self, url: impl ToString) -> Self {
if self.status < 300 || self.status > 308 {
self.status = 302;
Expand Down

0 comments on commit f90b1c5

Please sign in to comment.