svenstaro/miniserve

Panic when serving non-existent file in SPA mode

powder-pony opened this issue · 1 comments

When serving non-exisient file with --index and --spa, program will panic (IOT instruction (core dumped))

miniserve version: miniserve 0.24.0
OS: openSUSE x86_64

example:

ssss

Thanks. Apart from the fact that it shouldn't panic at this point, what do you think is the expected behavior? I think it should indeed just refuse to start as --spa --index without the file existing does indeed not make sense. We could handle this early in the program startup. Would you like to take a stab at this (and add a test while you're at it)? :)