mirror of
https://github.com/tauri-apps/plugins-workspace.git
synced 2026-11-30 00:43:40 +01:00
fix(upload): accept a plain object for headers (#3797)
* fix(upload): accept a plain object for headers Signed-off-by: sarankumar1325 <120080287+sarankumar1325@users.noreply.github.com> * Update .changes/upload-headers-record.md Co-authored-by: Tony <68118705+Legend-Master@users.noreply.github.com> * Apply suggestion from @lucasfernog --------- Signed-off-by: sarankumar1325 <120080287+sarankumar1325@users.noreply.github.com> Co-authored-by: Lucas Fernandes Nogueira <lucas@tauri.app> Co-authored-by: Tony <68118705+Legend-Master@users.noreply.github.com>
This commit is contained in:
2 files changed
+9
-3
No files matched your search
@@ -0,0 +1,6 @@
|
||||
---
|
||||
upload: patch
|
||||
upload-js: patch
|
||||
---
|
||||
|
||||
Accept a plain object for the `headers` argument of `upload` and `download`, as shown in their examples, in addition to a `Map`.
|
||||
@@ -89,8 +89,8 @@ async function upload(
|
||||
url: string,
|
||||
filePath: string,
|
||||
progressHandler?: ProgressHandler,
|
||||
// TODO: V3 - Combine headers and methods into one `options` object
|
||||
headers?: Map<string, string>,
|
||||
// TODO: V3 - Combine headers and methods into one `options` object, switch to HeadersInit
|
||||
headers?: Record<string, string> | Map<string, string>,
|
||||
method?: HttpMethod
|
||||
): Promise<string> {
|
||||
const ids = new Uint32Array(1)
|
||||
@@ -142,7 +142,7 @@ async function download(
|
||||
url: string,
|
||||
filePath: string,
|
||||
progressHandler?: ProgressHandler,
|
||||
headers?: Map<string, string>,
|
||||
headers?: Record<string, string> | Map<string, string>,
|
||||
body?: string
|
||||
): Promise<void> {
|
||||
const ids = new Uint32Array(1)
|
||||
|
||||
Reference in new issue
Block a user