Skip to content

Commit 5ab4b87

Browse files
committed
put the correct MIME type on errors.js
1 parent ecb8183 commit 5ab4b87

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

worker/src/Main.hs

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ main =
3232
[ ifTop $ status
3333
, path "repl" $ Repl.endpoint rArtifacts
3434
, path "compile" $ Compile.endpoint cArtifacts
35-
, path "compile/errors.js" $ writeBS errorJS
35+
, path "compile/errors.js" $ serveJavaScript errorJS
3636
, path "compile/deps-info.json" $ serveDepsInfo depsInfo
3737
, notFound
3838
]
@@ -56,6 +56,12 @@ notFound =
5656
writeBuilder "Not Found"
5757

5858

59+
serveJavaScript :: BS.ByteString -> Snap ()
60+
serveJavaScript javascript =
61+
do modifyResponse $ setContentType "application/javascript"
62+
writeBS javascript
63+
64+
5965
serveDepsInfo :: BS.ByteString -> Snap ()
6066
serveDepsInfo json =
6167
Cors.allow GET ["https://elm-lang.org"] $

0 commit comments

Comments
 (0)