Closed sago35 closed 2 years ago
Before the correction, addresses such as http://hostname:8088/ were not accessible.
For example, the following is a std-Go program that listens for 8088, but could not connect to
package main
import (
"fmt"
"log"
"net/http"
)
var (
ip = ""
port = 8088
cnt = 0
)
func handler(w http.ResponseWriter, req *http.Request) {
cnt++
fmt.Fprintf(w, "hello %d\n", cnt)
fmt.Printf("%d %#v\n", cnt, req.UserAgent())
}
func main() {
http.HandleFunc("/", handler)
fmt.Printf("listen: %s:%d\n", ip, port)
log.Fatal(http.ListenAndServe(fmt.Sprintf("%s:%d", ip, port), nil))
}
Thanks for the fix @sago35 now merging.
This PR corrects the behavior of
http.Get()
. Only http is affected, not https.Two items were corrected.