This fixes file uploads incorrectly showing MIME type as "Other" instead
of their actual content types by expanding the `MediaType` enum relay
to include common audio, video, and image formats.
Basically `MediaType` enum is used for both `ContentType` which would
map to `ContentType` from `hoppscotch-data` (e.g. `multipart/form-data`)
but also to `FormValue` in `interop`
```rust
pub enum FormValue {
...
File {
filename: String,
content_type: MediaType,
data: Bytes,
},
}
```
although the later should be much more pervasive.
This is a follow up on #5244
Closes FE-887
Closes #3810
Closes #5223
Closes #5233
The issue occurred because the `relay`'s `MediaType` couldn't deserialize
beyond the basic types (text, JSON, XML, etc.), lacked support for
other media file types. The TypeScript layer correctly detected MIME
types (e.g., "audio/x-m4a"), but the deserialization process fell back
to `MediaType::Other`. Main reason for servers performing strict MIME
validation to reject uploads.
57 lines
2 KiB
TOML
57 lines
2 KiB
TOML
[package]
|
|
name = "hoppscotch-desktop"
|
|
version = "25.7.0"
|
|
description = "Desktop App for hoppscotch.io"
|
|
authors = ["CuriousCorrelation"]
|
|
edition = "2021"
|
|
|
|
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
|
|
|
|
[lib]
|
|
# The `_lib` suffix may seem redundant but it is necessary
|
|
# to make the lib name unique and wouldn't conflict with the bin name.
|
|
# This seems to be only an issue on Windows, see https://github.com/rust-lang/cargo/issues/8519
|
|
name = "hoppscotch_desktop_lib"
|
|
crate-type = ["staticlib", "cdylib", "rlib"]
|
|
|
|
[build-dependencies]
|
|
tauri-build = { version = "2", features = [] }
|
|
|
|
[dependencies]
|
|
tauri = { version = "2", features = ["devtools"] }
|
|
tauri-plugin-shell = { version = "2", features = [] }
|
|
serde = { version = "1", features = ["derive"] }
|
|
serde_json = { version = "1", features = [] }
|
|
tracing = "0.1.41"
|
|
tracing-subscriber = { version = "0.3.18", features = ["env-filter"] }
|
|
tracing-appender = { version = "0.2.3" }
|
|
tauri-plugin-store = "2.2.0"
|
|
tauri-plugin-dialog = "2.2.0"
|
|
tauri-plugin-fs = "2.2.0"
|
|
tauri-plugin-deep-link = "2.2.0"
|
|
tauri-plugin-appload = { git = "https://github.com/CuriousCorrelation/tauri-plugin-appload", rev = "1b52e49d881926135838cf6cfebdc1643a9bec31" }
|
|
tauri-plugin-relay = { git = "https://github.com/CuriousCorrelation/tauri-plugin-relay", rev = "4ed4fcafeb93856591e8a36522f6ec6e340e4dc5" }
|
|
axum = "0.8.1"
|
|
tower-http = { version = "0.6.2", features = ["cors"] }
|
|
random-port = "0.1.1"
|
|
tokio = "1.43.0"
|
|
tauri-plugin-process = "2.2.0"
|
|
file-rotate = "0.8.0"
|
|
dirs = "6.0.0"
|
|
thiserror = "2.0.12"
|
|
native-dialog = { version = "0.7.0" }
|
|
tauri-plugin-http = { version = "2.0.1", features = ["gzip"] }
|
|
tauri-plugin-opener = "2"
|
|
semver = "1.0"
|
|
|
|
[target.'cfg(windows)'.dependencies]
|
|
tempfile = { version = "3.13.0" }
|
|
winreg = { version = "0.52.0" }
|
|
|
|
[target.'cfg(not(any(target_os = "android", target_os = "ios")))'.dependencies]
|
|
tauri-plugin-updater = "2.3.1"
|
|
tauri-plugin-window-state = "2.2.1"
|
|
|
|
[features]
|
|
default = []
|
|
portable = []
|