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.
62 lines
1.7 KiB
JSON
62 lines
1.7 KiB
JSON
{
|
|
"name": "@hoppscotch/kernel",
|
|
"version": "0.2.0",
|
|
"description": "Cross-platform runtime kernel for Hoppscotch platform-ops",
|
|
"type": "module",
|
|
"main": "dist/hoppscotch-kernel.cjs",
|
|
"module": "dist/hoppscotch-kernel.js",
|
|
"types": "./dist/index.d.ts",
|
|
"files": [
|
|
"dist/*"
|
|
],
|
|
"scripts": {
|
|
"dev": "vite build --watch",
|
|
"build:code": "vite build",
|
|
"build:decl": "tsc --project tsconfig.decl.json",
|
|
"build": "pnpm run build:code && pnpm run build:decl",
|
|
"prepare": "pnpm run build:code && pnpm run build:decl",
|
|
"do-typecheck": "pnpm exec tsc --noEmit"
|
|
},
|
|
"exports": {
|
|
".": {
|
|
"types": "./dist/index.d.ts",
|
|
"import": "./dist/hoppscotch-kernel.js",
|
|
"require": "./dist/hoppscotch-kernel.cjs"
|
|
}
|
|
},
|
|
"repository": {
|
|
"type": "git",
|
|
"url": "git+https://github.com/hoppscotch/hoppscotch.git"
|
|
},
|
|
"author": "Hoppscotch (support@hoppscotch.io)",
|
|
"license": "MIT",
|
|
"bugs": {
|
|
"url": "https://github.com/hoppscotch/hoppscotch/issues"
|
|
},
|
|
"homepage": "https://github.com/hoppscotch/hoppscotch#readme",
|
|
"devDependencies": {
|
|
"@types/node": "22.9.3",
|
|
"typescript": "5.8.3",
|
|
"vite": "5.4.11"
|
|
},
|
|
"peerDependencies": {
|
|
"@tauri-apps/api": "2.1.1"
|
|
},
|
|
"peerDependenciesMeta": {
|
|
"@tauri-apps/api": {
|
|
"optional": true
|
|
}
|
|
},
|
|
"dependencies": {
|
|
"axios": "1.8.2",
|
|
"fp-ts": "2.16.9",
|
|
"aws4fetch": "1.0.20",
|
|
"zod": "3.22.4",
|
|
"superjson": "2.2.2",
|
|
"@tauri-apps/plugin-shell": "2.0.1",
|
|
"@tauri-apps/plugin-dialog": "2.0.1",
|
|
"@tauri-apps/plugin-fs": "2.0.2",
|
|
"@tauri-apps/plugin-store": "2.2.0",
|
|
"@hoppscotch/plugin-relay": "github:CuriousCorrelation/tauri-plugin-relay#4ed4fcafeb93856591e8a36522f6ec6e340e4dc5"
|
|
}
|
|
}
|