1
0
Fork 0
mirror of https://github.com/librespot-org/librespot.git synced 2025-10-06 03:50:06 +02:00

Fail opening the stream for anything but HTTP 206

This commit is contained in:
Roderick van Domburg 2022-01-12 22:22:44 +01:00
parent 32df4a401d
commit 8d8d6d4fd8
No known key found for this signature in database
GPG key ID: A9EF5222A26F0451
2 changed files with 7 additions and 2 deletions

View file

@ -61,13 +61,12 @@ async fn receive_data(
};
let code = response.status();
let body = response.into_body();
if code != StatusCode::PARTIAL_CONTENT {
debug!("Streamer expected partial content but got: {}", code);
break Err(AudioFileError::StatusCode(code).into());
}
let body = response.into_body();
let data = match hyper::body::to_bytes(body).await {
Ok(bytes) => bytes,
Err(e) => break Err(e.into()),