mirror of
https://gitlab.com/nkming2/nc-photos.git
synced 2025-03-13 18:58:53 +01:00
No longer set content-type automatically
This commit is contained in:
parent
02e8bf0c76
commit
6e59b47f0b
1 changed files with 10 additions and 9 deletions
|
@ -61,14 +61,8 @@ class Api {
|
|||
header.entries.map((e) => MapEntry(e.key.toLowerCase(), e.value)));
|
||||
}
|
||||
if (body != null) {
|
||||
if (!req.headers.containsKey("content-type")) {
|
||||
req.headers["content-type"] = "application/xml";
|
||||
}
|
||||
req.body = body;
|
||||
} else if (bodyBytes != null) {
|
||||
if (!req.headers.containsKey("content-type")) {
|
||||
req.headers["content-type"] = "application/octet-stream";
|
||||
}
|
||||
req.bodyBytes = bodyBytes;
|
||||
}
|
||||
final response =
|
||||
|
@ -149,7 +143,7 @@ class _Files {
|
|||
"PUT",
|
||||
path,
|
||||
header: {
|
||||
"content-type": mime,
|
||||
"Content-Type": mime,
|
||||
},
|
||||
bodyBytes: content,
|
||||
);
|
||||
|
@ -293,6 +287,7 @@ class _Files {
|
|||
});
|
||||
return await _api.request("PROPFIND", path,
|
||||
header: {
|
||||
"Content-Type": "application/xml",
|
||||
if (depth != null) "Depth": depth.toString(),
|
||||
},
|
||||
body: builder.buildDocument().toXmlString());
|
||||
|
@ -341,8 +336,14 @@ class _Files {
|
|||
});
|
||||
}
|
||||
});
|
||||
return await _api.request("PROPPATCH", path,
|
||||
body: builder.buildDocument().toXmlString());
|
||||
return await _api.request(
|
||||
"PROPPATCH",
|
||||
path,
|
||||
header: {
|
||||
"Content-Type": "application/xml",
|
||||
},
|
||||
body: builder.buildDocument().toXmlString(),
|
||||
);
|
||||
} catch (e) {
|
||||
_log.severe("[proppatch] Failed while proppatch", e);
|
||||
rethrow;
|
||||
|
|
Loading…
Reference in a new issue