mirror of
https://github.com/Termix-SSH/Termix.git
synced 2026-10-30 07:05:24 +00:00
fix: accept the release .sig when installing a plugin from a file
This commit is contained in:
1 parent
3def536dcc
commit
b32203d19b
7 files changed
+146
-17
No files matched your search
@@ -643,11 +643,24 @@ export interface PluginUploadPreview {
|
||||
features?: string[];
|
||||
capabilities: string[];
|
||||
replaces: string | null;
|
||||
official?: boolean;
|
||||
}
|
||||
|
||||
export async function uploadPlugin(file: Blob): Promise<PluginUploadPreview> {
|
||||
export async function uploadPlugin(
|
||||
file: Blob,
|
||||
signature?: string,
|
||||
): Promise<PluginUploadPreview> {
|
||||
const response = await rbacApi.post("/plugins/upload", file, {
|
||||
headers: { "Content-Type": "application/octet-stream" },
|
||||
headers: {
|
||||
"Content-Type": "application/octet-stream",
|
||||
...(signature
|
||||
? {
|
||||
"X-Termix-Plugin-Signature": btoa(
|
||||
String.fromCharCode(...new TextEncoder().encode(signature)),
|
||||
),
|
||||
}
|
||||
: {}),
|
||||
},
|
||||
});
|
||||
return response.data;
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user