1
0
mirror of https://github.com/laurent22/joplin.git synced 2025-11-26 22:41:17 +02:00

All: Fixes 12810: Ensure the sync shows an error when the server is down, when using a local WebDAV server (#13301)

This commit is contained in:
mrjo118
2025-10-09 21:59:58 +01:00
committed by GitHub
parent 820acdc1f0
commit 53ea51b758
3 changed files with 39 additions and 4 deletions

View File

@@ -53,6 +53,11 @@ export const getSupportsDeltaWithItems = (deltaResponse: PaginatedList) => {
return 'jopItem' in deltaResponse.items[0];
};
export const isLocalServer = (url: string) => {
const regex = /^(https?:\/\/)?(localhost|127(?:\.\d{1,3}){3}|\[::1\])(?::\d{1,5})?(\/.*)?$/i;
return regex.test(url);
};
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- Old code before rule was applied
function requestCanBeRepeated(error: any) {
const errorCode = typeof error === 'object' && error.code ? error.code : null;