Skip to content

Commit

Permalink
chore: read RANGE_NOT_SATISFIABLE should return empty body
Browse files Browse the repository at this point in the history
  • Loading branch information
morristai committed Nov 3, 2023
1 parent 75dca1a commit a23b574
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions core/src/services/swift/backend.rs
Original file line number Diff line number Diff line change
Expand Up @@ -266,10 +266,11 @@ impl Accessor for SwiftBackend {
let resp = self.core.swift_read(path, args).await?;

match resp.status() {
StatusCode::OK | StatusCode::PARTIAL_CONTENT | StatusCode::RANGE_NOT_SATISFIABLE => {
StatusCode::OK | StatusCode::RANGE_NOT_SATISFIABLE => {
let size = parse_content_length(resp.headers())?;
Ok((RpRead::new().with_size(size), resp.into_body()))
}
},
StatusCode::RANGE_NOT_SATISFIABLE => Ok((RpRead::new(), IncomingAsyncBody::empty())),
_ => Err(parse_error(resp).await?),
}
}
Expand Down

0 comments on commit a23b574

Please sign in to comment.