I was reading the source code goto, and I found the code below in goto/talk/0/main.go:
http.Redirect(w, r, url, http.StatusFound)
According to the context, url
was an absolute path, and an absolute path redirect was expected. But as the golang/http/redirect mentioned:
Redirect
replies to the request with a redirect to url, which may be a path relative to the request path.
It results as a relative path redirect. I don't know if http.Redirect
did an absolute path redirect before, but it doesn't nowadays.
So how can I make an absolute path redirect in golang? I searched the Internet, but found nothing,can anyone help me? Thanks in advance.