Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
marcoieni committed Feb 4, 2025
1 parent 53ffd1e commit d909ad5
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 5 deletions.
7 changes: 2 additions & 5 deletions src/github/api/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ pub(crate) use write::GitHubWrite;
#[derive(Clone)]
pub(crate) struct HttpClient {
client: Client,
base_url: String,
}

impl HttpClient {
Expand All @@ -40,16 +39,14 @@ impl HttpClient {

Ok(Self {
client: builder.build()?,
base_url: "https://api.github.com/".to_string(),
})
}

fn req(&self, method: Method, url: &GitHubUrl) -> anyhow::Result<RequestBuilder> {
let url_str = format!("{}{}", self.base_url, url.url());
trace!("http request: {} {}", method, url_str);
trace!("http request: {} {}", method, url.url());
Ok(self
.client
.request(method, url_str)
.request(method, url.url())
.header(header::AUTHORIZATION, url.auth()))
}

Expand Down
1 change: 1 addition & 0 deletions src/github/api/url.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ pub struct GitHubUrl {

impl GitHubUrl {
pub fn new(url: String, auth: HeaderValue) -> Self {
let url = format!("https://api.github.com/{url}");
Self { url, auth }
}

Expand Down

0 comments on commit d909ad5

Please sign in to comment.