Skip to content

Commit

Permalink
Fix file->enclosure on Windows (closes #13)
Browse files Browse the repository at this point in the history
  • Loading branch information
otherjoel committed Nov 29, 2023
1 parent 490007a commit 2e8d39f
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions splitflap-lib/private/validation.rkt
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
net/url-string
racket/contract
racket/match
racket/path
racket/promise
racket/runtime-path
racket/string
Expand Down Expand Up @@ -309,8 +310,8 @@
(-> path-string? valid-url-string? enclosure?)
(unless (eq? 'file (file-or-directory-type file-path))
(raise-argument-error 'file->enclosure "path to an existing file" file-path))
(define filename (car (reverse (explode-path file-path))))
(enclosure (path->string (build-path (string->path base-url) filename))
(define filename (file-name-from-path file-path))
(enclosure (url->string (combine-url/relative (string->url base-url) (path->string filename)))
(path/string->mime-type filename)
(file-size file-path)))

Expand Down

0 comments on commit 2e8d39f

Please sign in to comment.