diff options
author | diegodox | 2021-11-04 03:24:52 +0000 |
---|---|---|
committer | GitHub | 2021-11-04 03:24:52 +0000 |
commit | 70d21a903fef3ec0787c453f369d95e5223a2656 (patch) | |
tree | 27b1461ef8bc7e530c9d19c7293a9d3241685555 /Cargo.lock | |
parent | 5b5d1b9dfff6b522559174f7f8e99aeb82c674a9 (diff) |
Prevent preview binary or large file (#939)
* Prevent preview binary or large file (#847)
* fix wrong method name
* fix add use trait
* update lock file
* rename MAX_PREVIEW_SIZE from MAX_BYTE_PREVIEW
* read small bytes to determine cotent type
* [WIP] add preview struct to represent calcurated preveiw
* Refactor content type detection
- Remove unwraps
- Reuse a single read buffer to avoid 1kb reallocations between previews
* Refactor preview rendering so we don't construct docs when not necessary
* Replace unwarap whit Preview::NotFound
* Use index access to hide unwrap
Co-authored-by: Blaž Hrastnik <blaz@mxxn.io>
* fix Get and unwarp equivalent to referce of Index acess
* better preview implementation
* Rename Preview enum and vairant
Co-authored-by: Gokul Soumya <gokulps15@gmail.com>
* fixup! Rename Preview enum and vairant
* simplify long match
* Center text, add docs, fix formatting, refactor
Co-authored-by: Blaž Hrastnik <blaz@mxxn.io>
Co-authored-by: Gokul Soumya <gokulps15@gmail.com>
Diffstat (limited to 'Cargo.lock')
-rw-r--r-- | Cargo.lock | 10 |
1 files changed, 10 insertions, 0 deletions
@@ -111,6 +111,15 @@ dependencies = [ ] [[package]] +name = "content_inspector" +version = "0.2.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b7bda66e858c683005a53a9a60c69a4aca7eeaa45d124526e389f7aec8e62f38" +dependencies = [ + "memchr", +] + +[[package]] name = "crossbeam-utils" version = "0.8.5" source = "registry+https://github.com/rust-lang/crates.io-index" @@ -415,6 +424,7 @@ version = "0.5.0" dependencies = [ "anyhow", "chrono", + "content_inspector", "crossterm", "fern", "futures-util", |