File tree Expand file tree Collapse file tree 4 files changed +8
-5
lines changed Expand file tree Collapse file tree 4 files changed +8
-5
lines changed Original file line number Diff line number Diff 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 " :
Original file line number Diff line number Diff 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 "
Original file line number Diff line number Diff 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 " ) ,
Original file line number Diff line number Diff line change 11ignore :
2+ - FlyingFox/Sources/HTTPDecoder+StandardizePath.swift
23 - FlyingFox/Tests
34 - FlyingSocks/Tests
You can’t perform that action at this time.
0 commit comments