Skip to content

Commit

Permalink
Merge branch 'ide' of github.com:mighty-gerbils/gerbil into ide
Browse files Browse the repository at this point in the history
  • Loading branch information
drewc committed Jan 15, 2025
2 parents ec4ff99 + eb4ea21 commit 39e2b56
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions src/tools/gxhttpd.ss
Original file line number Diff line number Diff line change
Expand Up @@ -478,11 +478,11 @@
=> :procedure
(let* ((content-type (path-extension->mime-type-name path))
(headers
[(if content-type
[["Content-Length" :: (number->string (file-info-size info))]
(if content-type
["Content-Type" :: content-type]
["Content-Type" :: "application/octet-stream"])
["Last-Modified" :: (number->string (exact (floor (time->seconds (file-info-last-modification-time info)))))]
["Content-Length" :: (number->string (file-info-size info))]]))
["Last-Modified" :: (number->string (exact (floor (time->seconds (file-info-last-modification-time info)))))]]))

(if (fx<= (file-info-size info) max-file-cache-size)
;; cache the content
Expand All @@ -501,12 +501,13 @@
(using (req :- http-request)
(case req.method
((GET)
(http-response-file res headers path))
(http-response-file res (cdr headers) path))
((HEAD)
(http-response-write res 200 headers #f))
(else
(http-response-write-condition res Forbidden))))))))


(def (find-handler tab server-path)
(let loop ((path server-path))
(cond
Expand Down

0 comments on commit 39e2b56

Please sign in to comment.