• Eivind Uggedal's avatar
    http: make HEAD client request follow redirects · 092f34fe
    Eivind Uggedal authored
    HEAD requests should in my opinion have the ability to follow redirects
    like the implementation of GET requests does. My use case is polling
    several thousand severs to check if they respond with 200 status codes.
    Using GET requests is neither efficient in running time of the task nor
    for bandwidth consumption.
    
    This suggested patch changes the return signature of http.Head() to match
    that of http.Get(), providing the final URL in a redirect chain.
    
    `curl -IL http://google.com` follows redirects with HEAD requests just fine.
    
    Fixes #1806.
    
    R=golang-dev, bradfitz, rsc
    CC=golang-dev
    https://golang.org/cl/4517058
    092f34fe
Name
Last commit
Last update
doc Loading commit data...
include Loading commit data...
lib Loading commit data...
misc Loading commit data...
src Loading commit data...
test Loading commit data...
.hgignore Loading commit data...
.hgtags Loading commit data...
AUTHORS Loading commit data...
CONTRIBUTORS Loading commit data...
LICENSE Loading commit data...
PATENTS Loading commit data...
README Loading commit data...
favicon.ico Loading commit data...
robots.txt Loading commit data...