Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

--ext option not functional #160

Closed
premasagar opened this issue Jun 15, 2015 · 4 comments · Fixed by #590
Closed

--ext option not functional #160

premasagar opened this issue Jun 15, 2015 · 4 comments · Fixed by #590

Comments

@premasagar
Copy link

I find that when an html file is saved without a file extension, http-server serves it with application/octet-stream, even if I set --ext html in the cli options (anyway, html is the default).

Seen on Mac Yosemite; Node v2.0.2

@leo60228
Copy link

+1

1 similar comment
@Lacrymology
Copy link

+1

@wamoyo
Copy link

wamoyo commented Mar 23, 2017

So this has been here since 2015? Hmm... wonder if it's a browser caching thing... I'll have a look on this.

@BigBlueHat
Copy link
Member

A quick fix would simply be reordering this code and handling the html default extension by also setting text/html as the default media type:
https://github.com/indexzero/http-server/blob/fed98f2dbb87f1ea7a793e48a1975c20c9e970fa/lib/http-server.js#L50-L56

Anyone up for doing that? 😸

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants