jetzig-framework / jetzig

Jetzig is a web framework written in Zig
MIT License
579 stars 25 forks source link

Bug on windows with subfolders in public folder #87

Closed drsneed closed 5 months ago

drsneed commented 5 months ago

Hello, I discovered that on Windows, Jetzig fails to serve any files that are in subfolders inside the public folder. This is because line 605 in jetzig/http/Server.zig is comparing a windows path ("foo\bar") with a posix path ("foo/bar").

I can submit a pull request but I'm not sure if my solution is the best, I'm just replacing "\" with "/" before the comparison. Thanks,

bobf commented 5 months ago

@drsneed Thanks for reporting. Normalising paths on / is fine (i.e. replacing \ with /) in most cases I think (some edge cases but oh well). If you want to submit a PR I will definitely merge it. : )

drsneed commented 5 months ago

Thanks I submitted one.