Skip to content

Commit 4ee7733

Browse files
authored
fixed retry header
1 parent ef571f8 commit 4ee7733

File tree

2 files changed

+1
-5
lines changed

2 files changed

+1
-5
lines changed

Jellyfin.HardwareVisualizer/Server/Controllers/SubmissionApiController.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ public async Task<IActionResult> Submit([Required, FromBody]TranscodeSubmission
7272

7373
if (!_submitTokenService.Validate(token, out var retry))
7474
{
75-
Response.Headers.RetryAfter = new StringValues(retry.Value.Seconds.ToString());
75+
Response.Headers.RetryAfter = new StringValues(retry.Value.TotalSeconds.ToString());
7676
return Unauthorized();
7777
}
7878

Jellyfin.HardwareVisualizer/Server/Services/SubmitToken/SubmitTokenService.cs

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -73,10 +73,6 @@ public bool Validate(JwtPayload token, out TimeSpan? retryAfter)
7373
public (string? token, TimeSpan? retryAfter) GenerateToken()
7474
{
7575
var ipAddress = _httpContextAccessor.HttpContext.Connection.RemoteIpAddress.ToString();
76-
_httpContextAccessor.HttpContext.Request.Headers.TryGetValue("X-Forwarded-For", out var value);
77-
78-
_logger.LogInformation($"Ip {ipAddress} requested a new Token with {value}.");
79-
8076
var cacheKey = "ip-token-" + ipAddress;
8177
if (_memoryCache.TryGetValue<TokenStore>(cacheKey, out var tokenStore)
8278
&& tokenStore.JwtPayload.ValidTo > DateTime.UtcNow)

0 commit comments

Comments
 (0)