This commit is contained in:
Michael Jerger 2023-08-15 08:09:27 +02:00
parent 7d2d197cbb
commit 2be0a44aa8
2 changed files with 5 additions and 0 deletions

View file

@ -22,6 +22,8 @@ class Artifact(Validateable):
match suffix: match suffix:
case ".jar": case ".jar":
return "application/x-java-archive" return "application/x-java-archive"
case ".js":
return "application/x-javascript"
case _: case _:
return "text/plain" return "text/plain"

View file

@ -24,6 +24,9 @@ def test_should_calculate_type():
sut = Artifact("x.jar") sut = Artifact("x.jar")
assert "application/x-java-archive" == sut.type() assert "application/x-java-archive" == sut.type()
sut = Artifact("x.js")
assert "application/x-javascript" == sut.type()
sut = Artifact("x.jar.sha256") sut = Artifact("x.jar.sha256")
assert "text/plain" == sut.type() assert "text/plain" == sut.type()