diff options
| author | Archie <3836@iona.vic.edu.au> | 2025-06-27 09:49:07 +1000 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-06-26 17:49:07 -0600 |
| commit | d5a76bdff8fa7c7771f4bb5d64c4e0ac254e8927 (patch) | |
| tree | f60fd3b70b669ba175b2b6e28e523cf88e50fa5e /Jellyfin.Server/Filters/RetryOnTemporarilyUnavailableFilter.cs | |
| parent | ebdc756547ece276b9051226903d2d6794fe6e2b (diff) | |
Changed misspell of 'temporarily' in 503 response (#14377)
Diffstat (limited to 'Jellyfin.Server/Filters/RetryOnTemporarilyUnavailableFilter.cs')
| -rw-r--r-- | Jellyfin.Server/Filters/RetryOnTemporarilyUnavailableFilter.cs | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/Jellyfin.Server/Filters/RetryOnTemporarilyUnavailableFilter.cs b/Jellyfin.Server/Filters/RetryOnTemporarilyUnavailableFilter.cs new file mode 100644 index 000000000..fef5577a1 --- /dev/null +++ b/Jellyfin.Server/Filters/RetryOnTemporarilyUnavailableFilter.cs @@ -0,0 +1,36 @@ +using System; +using System.Collections.Generic; +using System.Net.Http.Headers; +using Microsoft.OpenApi.Models; +using Swashbuckle.AspNetCore.SwaggerGen; + +namespace Jellyfin.Server.Filters; + +internal class RetryOnTemporarilyUnavailableFilter : IOperationFilter +{ + public void Apply(OpenApiOperation operation, OperationFilterContext context) + { + operation.Responses.Add("503", new OpenApiResponse() + { + Description = "The server is currently starting or is temporarily not available.", + Headers = new Dictionary<string, OpenApiHeader>() + { + { + "Retry-After", + new() { AllowEmptyValue = true, Required = false, Description = "A hint for when to retry the operation in full seconds." } + }, + { + "Message", + new() { AllowEmptyValue = true, Required = false, Description = "A short plain-text reason why the server is not available." } + } + }, + Content = new Dictionary<string, OpenApiMediaType>() + { + { + "text/html", + new OpenApiMediaType() + } + } + }); + } +} |
