Skip to content

Commit

Permalink
Fix nullable warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
PJB3005 committed Jun 11, 2024
1 parent ba73d81 commit 8320b7c
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
3 changes: 2 additions & 1 deletion Robust.Cdn/Controllers/DownloadController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -315,7 +315,8 @@ public async Task<IActionResult> Download(string version)

// TODO: Crappy Accept-Encoding parser
private bool AcceptsZStd => Request.Headers.AcceptEncoding.Count > 0
&& Request.Headers.AcceptEncoding[0].Contains("zstd");
&& Request.Headers.AcceptEncoding[0] is { } header
&& header.Contains("zstd");

public sealed class NoOpActionResult : IActionResult
{
Expand Down
2 changes: 1 addition & 1 deletion Robust.Cdn/Controllers/UpdateController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ public async Task<IActionResult> PostControlUpdate()
var auth = authHeader[0];

// Idk does using Bearer: make sense here?
if (!auth.StartsWith("Bearer "))
if (auth == null || !auth.StartsWith("Bearer "))
return Unauthorized("Need Bearer: auth type");

var token = auth["Bearer ".Length..];
Expand Down

0 comments on commit 8320b7c

Please sign in to comment.