http-server icon indicating copy to clipboard operation
http-server copied to clipboard

Adding contentType cli option to address #276

Open howardroark opened this issue 9 years ago • 5 comments

fixes #296, fixes #276

howardroark avatar Jun 22 '16 13:06 howardroark

Hey @howardroark, couple of linting issues on this failed the CI build.

Jameskmonger avatar Jun 22 '16 16:06 Jameskmonger

Thanks @Jameskmonger ! Fixed ;)

howardroark avatar Jun 22 '16 16:06 howardroark

@Jameskmonger Hi, will this be merged ?

It is very useful in my case where I have static website and prefer the urls to be of a form /about without the extension /about.html. The files are saved in the file system without the extension but need to be served with the correct Content-Type in order to be parsed correctly.

Just a small note, its not very correct that Use a custom Content-Type response header for all requests. As I see in the ecstatic source code, the --contentType param is being used only if the mime.lookup fails. IMO its great because it means that this param is a fallback rather than override of expected behavior (e.g. override the Content-Type header of a javascript file to html file's content type).

borisirota avatar Nov 23 '16 08:11 borisirota

I know this PR is a few years old, @howardroark I can take this over if you'd like me to

thornjad avatar Oct 15 '21 16:10 thornjad

Oh boy.

mmahut avatar Feb 12 '23 21:02 mmahut