1
0
Fork 0
mirror of https://github.com/librespot-org/librespot.git synced 2025-10-05 10:49:40 +02:00

Move ConnectConfig to connect

This commit is contained in:
Roderick van Domburg 2022-01-05 21:15:19 +01:00
parent 1a7c440bd7
commit cc9a574b2e
No known key found for this signature in database
GPG key ID: A9EF5222A26F0451
12 changed files with 137 additions and 175 deletions

View file

@ -98,7 +98,10 @@ impl SpClient {
let body = protobuf::text_format::print_to_string(message);
let mut headers = headers.unwrap_or_else(HeaderMap::new);
headers.insert(CONTENT_TYPE, "application/protobuf".parse()?);
headers.insert(
CONTENT_TYPE,
HeaderValue::from_static("application/protobuf"),
);
self.request(method, endpoint, Some(headers), Some(body))
.await
@ -112,7 +115,7 @@ impl SpClient {
body: Option<String>,
) -> SpClientResult {
let mut headers = headers.unwrap_or_else(HeaderMap::new);
headers.insert(ACCEPT, "application/json".parse()?);
headers.insert(ACCEPT, HeaderValue::from_static("application/json"));
self.request(method, endpoint, Some(headers), body).await
}