{"id":15018062,"url":"https://github.com/rydz/rocket_seek_stream","last_synced_at":"2025-10-06T00:37:39.130Z","repository":{"id":35101782,"uuid":"206820549","full_name":"rydz/rocket_seek_stream","owner":"rydz","description":"Rocket-rs responder to range requests using types that implement Read + Seek","archived":false,"fork":false,"pushed_at":"2023-05-04T08:08:51.000Z","size":56,"stargazers_count":26,"open_issues_count":0,"forks_count":9,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-08-25T00:41:05.284Z","etag":null,"topics":["partial-content","range-requests","rocket","rocket-rs","rust"],"latest_commit_sha":null,"homepage":"","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/rydz.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2019-09-06T15:14:18.000Z","updated_at":"2024-11-15T16:08:38.000Z","dependencies_parsed_at":"2024-09-12T03:24:16.850Z","dependency_job_id":"d0af3149-5ad0-49fd-be2e-b5c8f3f2d6b3","html_url":"https://github.com/rydz/rocket_seek_stream","commit_stats":{"total_commits":28,"total_committers":4,"mean_commits":7.0,"dds":0.2857142857142857,"last_synced_commit":"519601b2250b6164b9617601b38826c73915f842"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/rydz/rocket_seek_stream","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rydz%2Frocket_seek_stream","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rydz%2Frocket_seek_stream/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rydz%2Frocket_seek_stream/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rydz%2Frocket_seek_stream/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/rydz","download_url":"https://codeload.github.com/rydz/rocket_seek_stream/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rydz%2Frocket_seek_stream/sbom","scorecard":{"id":792827,"data":{"date":"2025-08-11","repo":{"name":"github.com/rydz/rocket_seek_stream","commit":"5d54d552ab8f690ed9496fb99ecd8f36b28c927e"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":2.1,"checks":[{"name":"Pinned-Dependencies","score":-1,"reason":"no dependencies found","details":null,"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"Code-Review","score":1,"reason":"Found 4/22 approved changesets -- score normalized to 1","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Maintained","score":0,"reason":"0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Token-Permissions","score":-1,"reason":"No tokens found","details":null,"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"Dangerous-Workflow","score":-1,"reason":"no workflows found","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE.md:0","Info: FSF or OSI recognized license: MIT License: LICENSE.md:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Branch-Protection","score":0,"reason":"branch protection not enabled on development/release branches","details":["Warn: branch protection not enabled for branch 'master'"],"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}},{"name":"SAST","score":0,"reason":"SAST tool is not run on all commits -- score normalized to 0","details":["Warn: 0 commits out of 12 are checked with a SAST tool"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}},{"name":"Vulnerabilities","score":2,"reason":"8 existing vulnerabilities detected","details":["Warn: Project is vulnerable to: RUSTSEC-2024-0003 / GHSA-8r5v-vm4m-4g25","Warn: Project is vulnerable to: RUSTSEC-2024-0332 / GHSA-q6cp-qfwq-4gcv","Warn: Project is vulnerable to: RUSTSEC-2024-0384","Warn: Project is vulnerable to: RUSTSEC-2024-0019 / GHSA-r8w9-5wcg-vfj7","Warn: Project is vulnerable to: GHSA-c827-hfw6-qwvm","Warn: Project is vulnerable to: GHSA-rr8g-9fpq-6wmg","Warn: Project is vulnerable to: RUSTSEC-2025-0023","Warn: Project is vulnerable to: RUSTSEC-2023-0078 / GHSA-8f24-6m29-wm2r"],"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}}]},"last_synced_at":"2025-08-23T08:03:19.818Z","repository_id":35101782,"created_at":"2025-08-23T08:03:19.818Z","updated_at":"2025-08-23T08:03:19.818Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":278542661,"owners_count":26004060,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-10-05T02:00:06.059Z","response_time":54,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["partial-content","range-requests","rocket","rocket-rs","rust"],"created_at":"2024-09-24T19:51:23.222Z","updated_at":"2025-10-06T00:37:39.109Z","avatar_url":"https://github.com/rydz.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# rocket_seek_stream\n\n[crates.io](https://crates.io/crates/rocket_seek_stream)\n\nA [Rocket](https://github.com/SergioBenitez/Rocket) responder for types implementing the `AsyncRead + AsyncSeek` traits, such as files and `rocket::futures::io::Cursor`, that will respond to range requests with a 206 Partial Content response. The `Content-Type` can optionally be inferred by taking a sample of bytes from the beginning of the stream, or given manually. An `Accept-Ranges: bytes` header will be sent in all responses to notify browsers that range requests are supported for the resource.\n\nThis supports both single and multipart/byterange requests.\n[https://tools.ietf.org/html/rfc7233](https://tools.ietf.org/html/rfc7233)\n\n## Cargo.toml\n\nAdd this to your dependencies.\n\n```\nrocket_seek_stream = {git=\"https://github.com/rydz/rocket_seek_stream\"}\n```\n\n## Examples\n\nServing a file from the disk\n\n```rust\n#![feature(proc_macro_hygiene, decl_macro)]\n#[macro_use]\nextern crate rocket;\nuse rocket_seek_stream::SeekStream;\n\n#[get(\"/\")]\nfn home\u003c'a\u003e() -\u003e std::io::Result\u003cSeekStream\u003c'a\u003e\u003e {\n    SeekStream::from_path(\"kosmodrom.webm\")\n}\n\n#[rocket::main]\nasync fn main() {\n    match rocket::build().mount(\"/\", routes![home]).launch().await {\n        Ok(_) =\u003e (),\n        Err(e) =\u003e {\n            eprintln!(\"Rocket stopped unexpectedly. (Error {})\", e);\n        }\n    };\n}\n```\n\nServing an in memory buffer\n\n```rust\n#[get(\"/\")]\nfn cursor\u003c'a\u003e() -\u003e SeekStream\u003c'a\u003e {\n    let bytes = \u0026include_bytes!(\"./fly_me_to_the_moon.webm\")[..];\n    let len = bytes.len();\n    let stream = std::io::Cursor::new(bytes);\n\n    SeekStream::with_opts(stream, len as u64, \"video/webm\")\n}\n```\n\nUse `cargo run --example server` to run the example. run `examples/download.sh` to download the media it depends on using [yt-dlp](https://github.com/yt-dlp/yt-dlp).\n\n## TODO\n\n- Write some tests\n\nI've compared the output of the Golang stdlib http router's multipart response to what I output here and it looks about the same except for a small difference in whitespace.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frydz%2Frocket_seek_stream","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frydz%2Frocket_seek_stream","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frydz%2Frocket_seek_stream/lists"}