http-party / http-server

a simple zero-configuration command-line http server
MIT License
13.42k stars 1.48k forks source link

disable favicon error #796

Closed yukulele closed 2 years ago

yukulele commented 2 years ago

What's the problem this feature will solve?

My browser show this error each time a reload my page:

GET http://127.0.0.1:8080/favicon.ico [[HTTP/1.1 404 Not Found 4ms]]()

I only want to see the messages related to the current development.

Describe the solution you'd like

http-server should send HTTP 204 No Content success status response code by default when favicon.ico is not in public directory

Alternative Solutions

I can get a favicon.ico file and add it to the directory but

zbynek commented 2 years ago

Maybe better to handle this in your code with one of the solutions from https://stackoverflow.com/a/13416784 ? From user's perspective it's better if you can avoid requesting a non-existing file instead of returning an empty answer. Some developers may prefer to see the warning if such redundant requests are made.

thornjad commented 2 years ago

If the file doesn't exist, isn't 404 the correct response?