Skip to content

Commit 7497784

Browse files
committed
restoring application/javascript for compatibility
1 parent 50e4822 commit 7497784

File tree

4 files changed

+8
-5
lines changed

4 files changed

+8
-5
lines changed

FlyingFox/Sources/Handlers/FileHTTPHandler.swift

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,8 @@ public struct FileHTTPHandler: HTTPHandler {
5757
switch pathExtension {
5858
case "wasm":
5959
return "application/wasm"
60+
case "js", "javascript":
61+
return "application/javascript"
6062
case "properties":
6163
return "text/plain"
6264
default:
@@ -79,7 +81,7 @@ public struct FileHTTPHandler: HTTPHandler {
7981
case "css":
8082
return "text/css"
8183
case "js", "javascript":
82-
return "text/javascript"
84+
return "application/javascript"
8385
case "png":
8486
return "image/png"
8587
case "jpeg", "jpg":

FlyingFox/Tests/Handlers/HTTPHandlerTests.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -135,10 +135,10 @@ struct HTTPHandlerTests {
135135
FileHTTPHandler.makeContentType(for: "fish.css") == "text/css"
136136
)
137137
#expect(
138-
FileHTTPHandler.makeContentType(for: "fish.js") == "text/javascript"
138+
FileHTTPHandler.makeContentType(for: "fish.js") == "application/javascript"
139139
)
140140
#expect(
141-
FileHTTPHandler.makeContentType(for: "fish.javascript") == "text/javascript"
141+
FileHTTPHandler.makeContentType(for: "fish.javascript") == "application/javascript"
142142
)
143143
#expect(
144144
FileHTTPHandler.makeContentType(for: "fish.png") == "image/png"

FlyingFox/XCTests/Handlers/HTTPHandlerTests.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -126,11 +126,11 @@ final class HTTPHandlerTests: XCTestCase {
126126
)
127127
XCTAssertEqual(
128128
FileHTTPHandler.makeContentType(for: "fish.js"),
129-
"text/javascript"
129+
"application/javascript"
130130
)
131131
XCTAssertEqual(
132132
FileHTTPHandler.makeContentType(for: "fish.javascript"),
133-
"text/javascript"
133+
"application/javascript"
134134
)
135135
XCTAssertEqual(
136136
FileHTTPHandler.makeContentType(for: "fish.png"),

codecov.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
ignore:
2+
- FlyingFox/Sources/HTTPDecoder+StandardizePath.swift
23
- FlyingFox/Tests
34
- FlyingSocks/Tests

0 commit comments

Comments
 (0)