mirror of
https://git.v0l.io/Kieran/void.cat.git
synced 2025-04-01 00:58:00 +02:00
Fix upload bug
This commit is contained in:
parent
67b5ef2b10
commit
66ffa7ca73
@ -71,7 +71,7 @@ namespace VoidCat.Controllers
|
||||
var digest = Request.Headers.GetHeader("V-Digest");
|
||||
var vf = await _storage.Ingress(new(Request.Body, fileInfo.Metadata, digest!)
|
||||
{
|
||||
EditSecret = editSecret?.FromBase58Guid(),
|
||||
EditSecret = editSecret?.FromBase58Guid() ?? Guid.Empty,
|
||||
Id = gid
|
||||
}, HttpContext.RequestAborted);
|
||||
|
||||
|
@ -46,7 +46,7 @@ services.AddCors(opt =>
|
||||
{
|
||||
p.AllowCredentials()
|
||||
.AllowAnyMethod()
|
||||
.WithHeaders("V-Content-Type", "V-Filename", "V-Digest", "Content-Type", "Authorization")
|
||||
.WithHeaders("V-Content-Type", "V-Filename", "V-Digest", "V-EditSecret", "Content-Type", "Authorization")
|
||||
.WithOrigins(voidSettings.CorsOrigins.Select(a => a.OriginalString).ToArray());
|
||||
});
|
||||
});
|
||||
|
@ -138,7 +138,7 @@ export function FileUpload(props) {
|
||||
for (let s = 0; s < segments; s++) {
|
||||
let offset = s * UploadSize;
|
||||
let slice = props.file.slice(offset, offset + UploadSize, props.file.type);
|
||||
xhr = await xhrSegment(await slice.arrayBuffer(), xhr?.file?.id, xhr?.file?.editSecret);
|
||||
xhr = await xhrSegment(await slice.arrayBuffer(), xhr?.file?.id, xhr?.file?.metadata?.editSecret);
|
||||
if (!xhr.ok) {
|
||||
break;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user