Attempt to guess the content type of a file when opening with --raw (#13521)

# Description
Attempt to guess the content type of a file when opening with --raw and
set it in the pipeline metadata.

<img width="644" alt="Screenshot 2024-08-02 at 11 30 10"
src="https://github.com/user-attachments/assets/071f0967-c4dd-405a-b8c8-f7aa073efa98">


# User-Facing Changes
- Content of files can be directly piped into commands like `http post`
with the content type set appropriately when using `--raw`.
This commit is contained in:
Jack Wright
2024-08-06 02:36:24 -07:00
committed by GitHub
parent 4e83ccdf86
commit 73e8de9753
5 changed files with 70 additions and 6 deletions

View File

@ -9,6 +9,7 @@ use std::process::ExitStatus;
// Needs to be reexported for `nu!` macro
pub use nu_path;
#[derive(Debug)]
pub struct Outcome {
pub out: String,
pub err: String,