-
-
Notifications
You must be signed in to change notification settings - Fork 17
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
PDS: Implemented Import Repo API #57
base: main
Are you sure you want to change the base?
Conversation
…ng the CarReader read the stream itself - Added Unit tests for reading the car stream
See TheRipperoni#1 |
# Conflicts: # rsky-pds/src/apis/mod.rs
return Outcome::Error((Status::BadRequest, error)); | ||
} | ||
|
||
let import_datastream = data.open(content_length.megabytes()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
let import_datastream = data.open(content_length.megabytes()); | |
let import_datastream = data.open(content_length.bytes()); |
"Content-Length is greater than maximum of {max_import_size}" | ||
)); | ||
req.local_cache(|| Some(error.clone())); | ||
return Outcome::Error((Status::BadRequest, error)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
return Outcome::Error((Status::BadRequest, error)); | |
return Outcome::Error((Status::PayloadTooLarge, error)); |
None => { | ||
let error = ApiError::InvalidRequest("Missing content-length header".to_string()); | ||
req.local_cache(|| Some(error.clone())); | ||
Outcome::Error((Status::BadRequest, error)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Outcome::Error((Status::BadRequest, error)) | |
Outcome::Error((Status::LengthRequired, error)) |
req.local_cache(|| Some(error.clone())); | ||
Outcome::Error((Status::BadRequest, error)) | ||
} | ||
Some(res) => match res.parse::<usize>() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I know this is a little pedantic but perhaps worthwhile using the NonZeroU64.
I have an example in the PR I made.
Implemented functionality to import your repo to RSky PDS.
Reasons users may want to do that include but are not limited to: