Skip to content

Commit a8f15d5

Browse files
committed
Additional mime types
1 parent fd188d7 commit a8f15d5

File tree

2 files changed

+18
-0
lines changed

2 files changed

+18
-0
lines changed

FlyingFox/Sources/Handlers/FileHTTPHandler.swift

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,12 @@ public struct FileHTTPHandler: HTTPHandler {
6767
return "application/pdf"
6868
case "svg":
6969
return "image/svg+xml"
70+
case "ico":
71+
return "image/x-icon"
72+
case "webp":
73+
return "image/webp"
74+
case "jp2":
75+
return "image/jp2"
7076
default:
7177
return "application/octet-stream"
7278
}

FlyingFox/Tests/Handlers/HTTPHandlerTests.swift

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -145,6 +145,18 @@ final class HTTPHandlerTests: XCTestCase {
145145
FileHTTPHandler.makeContentType(for: "fish.svg"),
146146
"image/svg+xml"
147147
)
148+
XCTAssertEqual(
149+
FileHTTPHandler.makeContentType(for: "fish.ico"),
150+
"image/x-icon"
151+
)
152+
XCTAssertEqual(
153+
FileHTTPHandler.makeContentType(for: "fish.webp"),
154+
"image/webp"
155+
)
156+
XCTAssertEqual(
157+
FileHTTPHandler.makeContentType(for: "fish.jp2"),
158+
"image/jp2"
159+
)
148160
XCTAssertEqual(
149161
FileHTTPHandler.makeContentType(for: "fish.somefile"),
150162
"application/octet-stream"

0 commit comments

Comments
 (0)