Skip to content

Commit

Permalink
svg content type
Browse files Browse the repository at this point in the history
  • Loading branch information
swhitty committed Jun 15, 2023
1 parent a8301df commit 1169214
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
2 changes: 2 additions & 0 deletions FlyingFox/Sources/Handlers/FileHTTPHandler.swift
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,8 @@ public struct FileHTTPHandler: HTTPHandler {
return "image/jpeg"
case "pdf":
return "application/pdf"
case "svg":
return "image/svg+xml"
default:
return "application/octet-stream"
}
Expand Down
4 changes: 4 additions & 0 deletions FlyingFox/Tests/Handlers/HTTPHandlerTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,10 @@ final class HTTPHandlerTests: XCTestCase {
FileHTTPHandler.makeContentType(for: "fish.pdf"),
"application/pdf"
)
XCTAssertEqual(
FileHTTPHandler.makeContentType(for: "fish.svg"),
"image/svg+xml"
)
XCTAssertEqual(
FileHTTPHandler.makeContentType(for: "fish.somefile"),
"application/octet-stream"
Expand Down

0 comments on commit 1169214

Please sign in to comment.