Skip to content

Commit

Permalink
Fix comments.
Browse files Browse the repository at this point in the history
  • Loading branch information
jcamiel committed Aug 12, 2022
1 parent b14e5bc commit eaa5e72
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions packages/hurl/src/http/client.rs
Original file line number Diff line number Diff line change
Expand Up @@ -337,7 +337,7 @@ impl Client {
} else {
format!("{}?", url)
};
let s = self.encode_params(params);
let s = self.url_encode_params(params);
format!("{}{}", url, s)
}
}
Expand Down Expand Up @@ -417,7 +417,7 @@ impl Client {
/// Sets form params.
fn set_form(&mut self, params: &[Param]) {
if !params.is_empty() {
let s = self.encode_params(params);
let s = self.url_encode_params(params);
self.handle.post_fields_copy(s.as_str().as_bytes()).unwrap();
//self.handle.write_function(sink);
}
Expand Down Expand Up @@ -458,7 +458,7 @@ impl Client {
}

/// URL encodes parameters.
fn encode_params(&mut self, params: &[Param]) -> String {
fn url_encode_params(&mut self, params: &[Param]) -> String {
params
.iter()
.map(|p| {
Expand Down Expand Up @@ -494,6 +494,7 @@ impl Client {
}

/// Retrieves an optional location to follow
///
/// You need:
/// 1. the option follow_location set to true
/// 2. a 3xx response code
Expand Down Expand Up @@ -601,7 +602,7 @@ pub fn all_cookies(cookie_storage: &[Cookie], request_spec: &RequestSpec) -> Vec

/// Matches cookie for a given URL.
pub fn match_cookie(cookie: &Cookie, url: &str) -> bool {
// is it possible to do it with libcurl?
// FIXME: is it possible to do it with libcurl?
let url = match Url::parse(url) {
Ok(url) => url,
Err(_) => return false,
Expand Down

0 comments on commit eaa5e72

Please sign in to comment.