fix(server): answer every chunk request and out-of-range archive.json policies

The chunk endpoint raised the request body limit only before reading a chunk. A
chunk sent again after a lost answer, or to an unknown or finished upload, was left
unread above Kestrel's 1 MiB default, so Kestrel closed the connection instead of
delivering the answer. The limit is now raised before any answer, to the larger of
the upload's and the server's chunk size, and never lowered.

PUT /api/v1/archive/settings answered 500 when archive.json held a thumbnail size or
proxy quality out of range, which the admin API cannot set. It now answers 409
archive_policy with the policy to correct in details (Server.Error.ArchivePolicy).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_012iLMBNwBE2GnphAsu4cjaC
This commit is contained in:
Claude committed 2026-10-12 15:58:48 +00:00
1 parent e01887ef51
commit 98f301f5fd
7 files changed
+62 -4

No files matched your search

+1
View File
@@ -29,6 +29,7 @@
<data name="Server.Error.ArchiveBusy" xml:space="preserve"><value>Another program is changing the archive's settings; try again shortly.</value><comment>long</comment></data>
<data name="Server.Error.ArchiveManifest" xml:space="preserve"><value>The archive's archive.json is damaged, from a newer Titano or of another archive; check the archive folder.</value><comment>long</comment></data>
<data name="Server.Error.ArchiveOffline" xml:space="preserve"><value>The archive is offline or read-only; try again when it is back.</value><comment>long</comment></data>
<data name="Server.Error.ArchivePolicy" xml:space="preserve"><value>The archive's archive.json has a thumbnail or proxy setting Titano cannot use; correct it in the archive folder.</value><comment>long</comment></data>
<data name="Server.Error.ArchiveRoot" xml:space="preserve"><value>Its photos are the archive's root folder, which never moves to the trash.</value><comment>long</comment></data>
<data name="Server.Error.BadCredentials" xml:space="preserve"><value>Wrong user name or password.</value><comment>long</comment></data>
<data name="Server.Error.BadRequest" xml:space="preserve"><value>The request is not valid.</value><comment>long</comment></data>
+1
View File
@@ -27,6 +27,7 @@
<data name="Server.Error.ArchiveBusy" xml:space="preserve"><value>Un altro programma sta modificando le impostazioni dell'archivio; riprova tra poco.</value></data>
<data name="Server.Error.ArchiveManifest" xml:space="preserve"><value>Il file archive.json dell'archivio è danneggiato, di un Titano più recente o di un altro archivio; controlla la cartella dell'archivio.</value></data>
<data name="Server.Error.ArchiveOffline" xml:space="preserve"><value>L'archivio non è raggiungibile o è di sola lettura; riprova quando torna disponibile.</value></data>
<data name="Server.Error.ArchivePolicy" xml:space="preserve"><value>Il file archive.json dell'archivio ha un'impostazione delle miniature o dei proxy che Titano non può usare; correggila nella cartella dell'archivio.</value></data>
<data name="Server.Error.ArchiveRoot" xml:space="preserve"><value>Le sue foto sono la cartella principale dell'archivio, che non va mai nel cestino.</value></data>
<data name="Server.Error.BadCredentials" xml:space="preserve"><value>Nome utente o password errati.</value></data>
<data name="Server.Error.BadRequest" xml:space="preserve"><value>La richiesta non è valida.</value></data>