When the http package is used, the mode processing of /this root path is registered, and the browser will automatically request favicon.ico. Be careful to handle it, otherwise there will be two requests
func main() { log.Println( " listen on 8080...\r\ nAccess : http://127.0.0.1:8080 " ) // root path http.HandleFunc( " / " , index) http.ListenAndServe( " :8080 " , nil) } // Home page jump func index(w http.ResponseWriter, r * http.Request) { if r.URL.RequestURI() == " /favicon.ico " { return } }
Read More:
- WIN7 + IIS7 Service Unavailable HTTP Error 503. The service is unavailable.
- HTTP Error 502.5 – Process Failure (How to Fix)
- net core HTTP Error 502.5 – ANCM Out-Of-Process Startup Failure
- HTTP error 405.0 – method not allowed solution for put and delete operations of rest Service on iis7.5
- Job for network.service Failed because the control process exited with error code. See “SystemC
- systemctl start docker Job for docker.service failed because the control process exited with error
- Job for docker.service failed because the control process exited with error code. See systemctl sta
- [Solved] Error in registering Eureka for spring cloud micro service: classnotfoundexception: org.apache.http.conn.scheme.schemeregistry
- Winsw throws an exception “error 1067: unexpected process termination” when converting Java application to Windows Service
- nt service 1072 No need to restart, repeat the method of installing the service program or service driver
- Apache2 cannot be started and an error is reported for apache2.service failed because the control process exited with error code.
- Linux virtual machine network “job for” network.service failed because the control process exited with error code”
- Error parsing HTTP request header Note: further occurrences of HTTP header p
- Nginx start error: job for nginx.service failed because the control process exited with error code
- urlopen error unknown url type:httpë/HTTP Error 400:Bad Request
- python: HTTP Error 505: HTTP Version Not Supported
- Python uses requests to request and reports SSL: CERTIFICATE_VERIFY_FAILED error
- Vue error: did you register the component correctly? For.., make sure to provide the “name” option (solved)
- Centos7 executes the command service mysqld start and prompts Failed to start mysqld.service: Unit mysqld.service not loaded
- Springboot project: error parsing HTTP request header note: further occurrences of HTTP request parsing