Skip to content

Commit

Permalink
fix: force json for all plex client requests #147
Browse files Browse the repository at this point in the history
  • Loading branch information
lostb1t committed Jul 19, 2024
1 parent ce6ed00 commit b49c823
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/plex_client.rs
Original file line number Diff line number Diff line change
Expand Up @@ -88,11 +88,14 @@ impl PlexClient {
self.host,
&req.uri_mut().path_and_query().unwrap()
);

let mut headers = req.headers_mut().clone();
headers.remove(ACCEPT); // remove accept as we always do json request

let res = self
.http_client
.request(req.method_mut().to_owned(), url)
.headers(req.headers_mut().clone())
.headers(headers)
.send()
.await
.map_err(Error::other)?;
Expand Down

0 comments on commit b49c823

Please sign in to comment.