Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions .github/workflows/ci-cd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -51,12 +51,16 @@ jobs:
# (LagersystemLVHome, the Blazor Server UI project, is excluded - no unit-test
# practice on Razor markup here). Downloaded and committed by semantic-release below.
- run: dotnet tool install -g dotnet-reportgenerator-globaltool
# -*.g.cs excludes source-generator output (e.g. the LoggerMessage generator's
# 700+ lines under obj/) - generated code, same rationale as studylife's
# migrations exclusion.
- run: >
reportgenerator
-reports:"LagersystemLVHome.UnitTests/**/TestResults/**/coverage.cobertura.xml"
-targetdir:coverage-summary
-reporttypes:JsonSummary
-assemblyfilters:"-LagersystemLVHome"
-filefilters:"-*.g.cs"
- run: python3 scripts/generate_coverage_badge.py coverage-summary/Summary.json coverage-badge.json
- uses: actions/upload-artifact@v7
with:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -374,7 +374,11 @@ private void ValidateFileSignature(MemoryStream stream, string extension, string
throw new InvalidOperationException($"Keine Signatur-Validierung f\u00fcr {extension} definiert");
}

var headerBytes = new byte[signatures.Max(s => s.Length)];
// At least 12 bytes: the WebP check below needs the "WEBP" marker at offset 8-11,
// but .webp's only signature entry is the 4-byte RIFF header - sizing the buffer
// purely by signature length capped bytesRead at 4 and made the `bytesRead >= 12`
// guard unconditionally false, rejecting EVERY WebP upload including valid ones.
var headerBytes = new byte[Math.Max(12, signatures.Max(s => s.Length))];
var bytesRead = stream.Read(headerBytes, 0, headerBytes.Length);

var isValid = signatures.Any(signature =>
Expand Down
324 changes: 324 additions & 0 deletions LagersystemLVHome.UnitTests/Services/Inventory/ExpiryServiceTests.cs

Large diffs are not rendered by default.

Loading
Loading