Improve network usage for small text changes #166
2 changed files with 2 additions and 3 deletions
Fix
commit
c37cb3df83
|
|
@ -348,7 +348,7 @@ export class SyncService {
|
||||||
}
|
}
|
||||||
|
|
||||||
private getDefaultHeaders(
|
private getDefaultHeaders(
|
||||||
{ type }: { type?: "json" | "form" } = { type: undefined }
|
{ type }: { type?: "json" } = { type: undefined }
|
||||||
): Record<string, string> {
|
): Record<string, string> {
|
||||||
const headers: Record<string, string> = {
|
const headers: Record<string, string> = {
|
||||||
"device-id": this.deviceId,
|
"device-id": this.deviceId,
|
||||||
|
|
@ -357,8 +357,6 @@ export class SyncService {
|
||||||
|
|
||||||
if (type === "json") {
|
if (type === "json") {
|
||||||
headers["Content-Type"] = "application/json";
|
headers["Content-Type"] = "application/json";
|
||||||
} else if (type === "form") {
|
|
||||||
headers["Content-Type"] = "multipart/form-data";
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return headers;
|
return headers;
|
||||||
|
|
|
||||||
|
|
@ -350,6 +350,7 @@ mod tests {
|
||||||
#[test]
|
#[test]
|
||||||
fn test_restart_behavior() {
|
fn test_restart_behavior() {
|
||||||
let temp_dir = std::env::temp_dir().join("test_restart_behavior");
|
let temp_dir = std::env::temp_dir().join("test_restart_behavior");
|
||||||
|
let _ = fs::remove_dir_all(&temp_dir);
|
||||||
|
|
||||||
// Create initial writer and write some data
|
// Create initial writer and write some data
|
||||||
{
|
{
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue