Desk: a stale answer on an oversize fork is 422 fork_too_large (#44)
This commit is contained in:
parent
815304568f
commit
05dcceb203
2 changed files with 38 additions and 3 deletions
|
|
@ -229,6 +229,13 @@ public static class DeskEndpoints
|
|||
if (string.Equals(result.Answer.Code, DeskStatus.StaleFork, StringComparison.Ordinal))
|
||||
{
|
||||
var current = await door.ReadAsync(mind.Socket, context, result.Answer.ForkId, cancellationToken);
|
||||
if (current is DeskReadOutcome.ForkTooLarge(var largeFork))
|
||||
{
|
||||
// Nothing is recorded for a stale answer, and the card it would carry cannot be returned: permanent.
|
||||
await WriteJsonAsync(http, DeskRefusals.ForkTooLargeStatus, DeskRefusals.ForkTooLargeDocument(largeFork));
|
||||
return;
|
||||
}
|
||||
|
||||
if (current is not DeskReadOutcome.Found(var entry))
|
||||
{
|
||||
await WriteUnavailableAsync(http, desk);
|
||||
|
|
|
|||
Loading…
Reference in a new issue