1
0
mirror of https://github.com/golang/go synced 2024-10-05 09:11:21 -06:00
go/src/net
Harshavardhana 4ded58bd5a net/http/httputil: Keep response headers when response ContentLength is 0.
Current code does not print any response headers from httputil.DumpResponse().

   PUT /miniocloud/new-file HTTP/1.1
   Host: s3.amazonaws.com
   User-Agent: Go-http-client/1.1
   Content-Length: 11
   Accept-Encoding: gzip

   HTTP/1.1 200 OK

With this fix we get an appropriate output for httputil.DumpResponse().

   PUT /miniocloud/new-file HTTP/1.1
   Host: s3.amazonaws.com
   User-Agent: Go-http-client/1.1
   Content-Length: 11
   Accept-Encoding: gzip

   HTTP/1.1 200 OK
   Content-Length: 0
   Date: Thu, 14 Jan 2016 03:04:42 GMT
   Etag: "3e25960a79dbc69b674cd4ec67a72c62"
   Server: AmazonS3
   X-Amz-Id-2: qnXyH6sknlovV0Myy3emFAXTNtI/sQIcu1ZXNq/6wd17K32tQ7WNGB1qb3nzCpW2DhfeZ/MbWfw=
   X-Amz-Request-Id: 8422EACB0CC492BD

Fixes #13942

Change-Id: Ida063cc3524a96170d8a837893f7c9f49b6cf98e
Reviewed-on: https://go-review.googlesource.com/18624
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
2016-02-23 15:16:39 +00:00
..
http net/http/httputil: Keep response headers when response ContentLength is 0. 2016-02-23 15:16:39 +00:00
internal/socktest net/internal/socktest: add missing support for AcceptEx 2016-02-21 03:09:25 +00:00
mail net/mail: do not parse RFC 2047 tokens in quoted strings 2015-12-04 16:11:09 +00:00
rpc all: replace strings.Index with strings.Contains where possible 2016-02-19 01:06:05 +00:00
smtp net/smtp: give example addrs in docs 2015-07-15 05:34:29 +00:00
testdata net: fix parsing literal IPv6 address with zone identifier when using cgo 2015-12-04 02:50:00 +00:00
textproto net/textproto: accept multi-line error messages 2016-01-08 16:32:42 +00:00
url net/url: simplify value lookup 2016-02-21 04:00:01 +00:00
addrselect_test.go net: fix IPv4 address selection 2015-11-17 23:48:43 +00:00
addrselect.go net: fix IPv4 address selection 2015-11-17 23:48:43 +00:00
cgo_android.go net: clean up cgo 2015-04-17 23:19:19 +00:00
cgo_bsd.go net: clean up cgo 2015-04-17 23:19:19 +00:00
cgo_linux.go net: clean up cgo 2015-04-17 23:19:19 +00:00
cgo_netbsd.go net: clean up cgo 2015-04-17 23:19:19 +00:00
cgo_openbsd.go net: clean up cgo 2015-04-17 23:19:19 +00:00
cgo_resnew.go net: fix build on android 2015-06-18 00:45:12 +00:00
cgo_resold.go net: fix build on android 2015-06-18 00:45:12 +00:00
cgo_socknew.go net: fix parsing literal IPv6 address with zone identifier when using cgo 2015-12-04 02:50:00 +00:00
cgo_sockold.go net: fix parsing literal IPv6 address with zone identifier when using cgo 2015-12-04 02:50:00 +00:00
cgo_solaris.go net: add -lsendfile to cgo LDFLAGS for solaris 2015-08-30 22:01:07 +00:00
cgo_stub.go net: add mechanisms to force go or cgo lookup, and to debug default strategy 2015-07-09 22:19:41 +00:00
cgo_unix_test.go net: enable cgo test on solaris 2015-05-09 02:58:50 +00:00
cgo_unix.go net: fix parsing literal IPv6 address with zone identifier when using cgo 2015-12-04 02:50:00 +00:00
cgo_windows.go net: clean up cgo 2015-04-17 23:19:19 +00:00
conf_netcgo.go net: add mechanisms to force go or cgo lookup, and to debug default strategy 2015-07-09 22:19:41 +00:00
conf_test.go net: add mechanisms to force go or cgo lookup, and to debug default strategy 2015-07-09 22:19:41 +00:00
conf.go net: remove imports of strconv 2015-10-05 22:39:12 +00:00
conn_test.go net: simplify error messages in tests 2015-05-06 09:25:08 +00:00
dial_gen.go net: add Source field to OpError 2015-04-29 22:37:30 +00:00
dial_test.go net: deflake TestDialerDualStackFDLeak 2016-02-21 02:54:12 +00:00
dial.go net: document ":port" syntax in Dial, Listen, ListenPacket 2016-01-07 19:14:43 +00:00
dnsclient_test.go net: don't require recursion be available in DNS responses 2015-11-17 20:11:22 +00:00
dnsclient_unix_test.go net: fix TestUpdateResolvConf after CL 18860 2016-02-21 20:59:45 +00:00
dnsclient_unix.go net: fix race in (*resolverConfig).tryUpdate 2016-02-20 10:03:47 +00:00
dnsclient.go net: stop scanning for domain name once the first label has been found 2016-01-09 03:30:40 +00:00
dnsconfig_unix_test.go net: fix race in (*resolverConfig).tryUpdate 2016-02-20 10:03:47 +00:00
dnsconfig_unix.go net: fix race in (*resolverConfig).tryUpdate 2016-02-20 10:03:47 +00:00
dnsmsg_test.go net: fix packDomainName encoding of root and invalid names 2016-02-19 00:55:47 +00:00
dnsmsg.go all: fix typos 2016-02-23 13:58:47 +00:00
dnsname_test.go net: simplify sync.Once calls in tests 2015-05-14 01:47:35 +00:00
error_plan9_test.go net: add missing aborted connection handling on accept test 2016-02-21 03:32:36 +00:00
error_posix_test.go net: add missing aborted connection handling on accept test 2016-02-21 03:32:36 +00:00
error_test.go net: retighten test harnesses for dial cancelation 2015-12-16 01:05:47 +00:00
error_unix_test.go net: add missing aborted connection handling on accept test 2016-02-21 03:32:36 +00:00
error_windows_test.go net: add missing aborted connection handling on accept test 2016-02-21 03:32:36 +00:00
example_test.go
external_test.go net: fix the series of TestLookup and external tests 2015-05-20 07:54:37 +00:00
fd_mutex_test.go
fd_mutex.go
fd_plan9.go net: unblock plan9 TCP Read calls after socket close 2015-10-16 19:16:56 +00:00
fd_poll_nacl.go net: remove the dregs of old built-in poll server 2015-02-04 10:16:38 +00:00
fd_poll_runtime.go net: remove the dregs of old built-in poll server 2015-02-04 10:16:38 +00:00
fd_posix_test.go net: don't return io.EOF on reading data from datagram, raw sockets on windows 2015-01-01 05:21:32 +00:00
fd_posix.go net: don't return io.EOF on reading data from datagram, raw sockets on windows 2015-01-01 05:21:32 +00:00
fd_unix.go net: add Dialer.Cancel to cancel pending dials 2015-12-15 21:15:15 +00:00
fd_windows.go net: add missing aborted connection handling on accept test 2016-02-21 03:32:36 +00:00
file_plan9.go Revert "net, internal/syscall/unix: add SocketConn, SocketPacketConn" 2015-07-02 16:11:03 +00:00
file_stub.go Revert "net, internal/syscall/unix: add SocketConn, SocketPacketConn" 2015-07-02 16:11:03 +00:00
file_test.go net: add missing File{Conn,Listener,PacketConn} read/write tests 2015-12-14 03:14:53 +00:00
file_unix.go net: do not unlink unix socket in UnixListener created from fd 2015-12-11 04:43:44 +00:00
file_windows.go Revert "net, internal/syscall/unix: add SocketConn, SocketPacketConn" 2015-07-02 16:11:03 +00:00
file.go Revert "net, internal/syscall/unix: add SocketConn, SocketPacketConn" 2015-07-02 16:11:03 +00:00
hook_cloexec.go net: add socket system call hooks for testing 2015-03-31 23:07:42 +00:00
hook_plan9.go net: deflake TestDialTimeout 2015-04-02 01:04:49 +00:00
hook_unix.go net: fix the build even harder 2015-12-17 18:43:12 +00:00
hook_windows.go net: add missing aborted connection handling on accept test 2016-02-21 03:32:36 +00:00
hook.go net: fix build 2015-12-17 16:06:58 +00:00
hosts_test.go net: ensure lookupStatic* returns copy of slice to disallow cache corruption. 2016-02-21 16:36:56 +00:00
hosts.go net: ensure lookupStatic* returns copy of slice to disallow cache corruption. 2016-02-21 16:36:56 +00:00
interface_bsd_test.go net: relax IP interface address determination on linux 2015-06-27 00:39:30 +00:00
interface_bsd.go Revert "syscall: route_freebsd switch routing socket sysctl to use NET_RT_IFLISTL" 2015-12-05 07:45:01 +00:00
interface_darwin.go Revert "syscall: route_freebsd switch routing socket sysctl to use NET_RT_IFLISTL" 2015-12-05 07:45:01 +00:00
interface_dragonfly.go Revert "syscall: route_freebsd switch routing socket sysctl to use NET_RT_IFLISTL" 2015-12-05 07:45:01 +00:00
interface_freebsd.go Revert "syscall: route_freebsd switch routing socket sysctl to use NET_RT_IFLISTL" 2015-12-05 07:45:01 +00:00
interface_linux_test.go net: relax IP interface address determination on linux 2015-06-27 00:39:30 +00:00
interface_linux.go net: relax IP interface address determination on linux 2015-06-27 00:39:30 +00:00
interface_netbsd.go Revert "syscall: route_freebsd switch routing socket sysctl to use NET_RT_IFLISTL" 2015-12-05 07:45:01 +00:00
interface_openbsd.go Revert "syscall: route_freebsd switch routing socket sysctl to use NET_RT_IFLISTL" 2015-12-05 07:45:01 +00:00
interface_stub.go
interface_test.go net: make use of IPv4 for parsing routing information on windows 2015-12-19 10:00:04 +00:00
interface_unix_test.go net: relax IP interface address determination on linux 2015-06-27 00:39:30 +00:00
interface_windows_test.go net, internal/syscall/windows: fix interface and address identification on windows 2015-12-10 08:04:07 +00:00
interface_windows.go net: make use of IPv4 for parsing routing information on windows 2015-12-19 10:00:04 +00:00
interface.go net: add Source field to OpError 2015-04-29 22:37:30 +00:00
ip_test.go Revert "net: ensure that malformed domain names report a consistent error" 2016-01-08 17:18:00 +00:00
ip.go net: fix misidentification of link-local, global unicast IP addresses 2015-07-10 07:30:33 +00:00
ipraw_test.go net: ensure that ResolveIPAddr(addr.String()) reproduces addr 2015-07-10 06:51:55 +00:00
iprawsock_plan9.go net: don't return non-nil interface values as Source, Addr in OpError 2015-06-13 23:39:03 +00:00
iprawsock_posix.go net: add Dialer.Cancel to cancel pending dials 2015-12-15 21:15:15 +00:00
iprawsock.go net: ensure that ResolveIPAddr(addr.String()) reproduces addr 2015-07-10 06:51:55 +00:00
ipsock_plan9.go net: don't return non-nil interface values as Source, Addr in OpError 2015-06-13 23:39:03 +00:00
ipsock_posix.go net: add Dialer.Cancel to cancel pending dials 2015-12-15 21:15:15 +00:00
ipsock_test.go net: don't run IP stack required tests on IP stack disabled kernels 2015-05-07 01:50:23 +00:00
ipsock.go net: make Dial, Listen{,Packet} for TCP/UDP with invalid port fail 2015-11-01 05:28:17 +00:00
listen_test.go net: don't run multicast listen test on nil interface in short mode 2015-11-21 01:33:40 +00:00
lookup_plan9.go net: LookupAddr("127.0.0.1") is "localhost" not "localhost." on Plan 9 and Windows 2016-01-13 14:02:22 +00:00
lookup_stub.go net: LookupHost and Resolve{TCP,UDP,IP}Addr should use zone from getaddrinfo 2015-03-08 09:58:11 +00:00
lookup_test.go net: enable TestLookupDotsWithRemoteSource on builders 2016-01-23 10:20:58 +00:00
lookup_unix.go net: respect go vs cgo resolver selection in all lookup routines 2015-08-19 04:20:37 +00:00
lookup_windows_test.go net: LookupAddr("127.0.0.1") is "localhost" not "localhost." on Plan 9 and Windows 2016-01-13 14:02:22 +00:00
lookup_windows.go net: LookupAddr("127.0.0.1") is "localhost" not "localhost." on Plan 9 and Windows 2016-01-13 14:02:22 +00:00
lookup.go Revert "net: ensure that malformed domain names report a consistent error" 2016-01-08 17:18:00 +00:00
mac_test.go net: allow ParseMAC to parse 20-octet IPoIB link-layer address 2015-08-24 16:34:43 +00:00
mac.go net: allow ParseMAC to parse 20-octet IPoIB link-layer address 2015-08-24 16:34:43 +00:00
main_cloexec_test.go net: add socket system call hooks for testing 2015-03-31 23:07:42 +00:00
main_plan9_test.go net: deflake TestDialGoogle, TestResolveDialGoogle 2015-04-03 01:50:30 +00:00
main_posix_test.go net: fix TestDialGoogle with -ipv6 when CGO_ENABLED=0 2015-04-16 00:44:52 +00:00
main_test.go net: adjust dual stack support on dragonfly 2015-05-23 05:22:57 +00:00
main_unix_test.go net: add Listen system call hook for testing 2015-04-15 11:47:49 +00:00
main_windows_test.go net: add missing aborted connection handling on accept test 2016-02-21 03:32:36 +00:00
mockserver_test.go net: make newLocalListener handle network argument correcly 2016-02-21 02:55:23 +00:00
net_test.go net: add missing aborted connection handling on accept test 2016-02-21 03:32:36 +00:00
net_windows_test.go net: make TestInterfaceAddrsWithNetsh more robust 2016-02-16 17:16:00 +00:00
net.go net: add Dialer.Cancel to cancel pending dials 2015-12-15 21:15:15 +00:00
netgo_unix_test.go net: simplify error messages in tests 2015-05-06 09:25:08 +00:00
non_unix_test.go net: LookupAddr("127.0.0.1") is "localhost" not "localhost." on Plan 9 and Windows 2016-01-13 14:02:22 +00:00
nss_test.go net: use Go's DNS resolver when system configuration permits 2015-04-23 02:48:43 +00:00
nss.go net: use Go's DNS resolver when system configuration permits 2015-04-23 02:48:43 +00:00
packetconn_test.go net: simplify error messages in tests 2015-05-06 09:25:08 +00:00
parse_test.go net: make Dial, Listen{,Packet} for TCP/UDP with invalid port fail 2015-11-01 05:28:17 +00:00
parse.go net: check /etc/hosts for modifications every 5 seconds, not 5 minutes 2016-01-06 21:42:19 +00:00
pipe_test.go net: simplify error messages in tests 2015-05-06 09:25:08 +00:00
pipe.go net: add Source field to OpError 2015-04-29 22:37:30 +00:00
platform_test.go net: android no longer supports unix/unixgram 2015-10-19 19:27:22 +00:00
port_unix.go net: fix inconsistent error values on Lookup 2015-04-21 05:16:07 +00:00
protoconn_test.go net: simplify error messages in tests 2015-05-06 09:25:08 +00:00
sendfile_dragonfly.go net: fix comment in sendFile 2015-05-06 12:27:07 +00:00
sendfile_freebsd.go net: fix comment in sendFile 2015-05-06 12:27:07 +00:00
sendfile_linux.go net: fix comment in sendFile 2015-05-06 12:27:07 +00:00
sendfile_solaris.go net: disable sendfile on Solaris for now 2016-01-11 20:34:12 +00:00
sendfile_stub.go syscall, net: use sendfile on Solaris 2015-05-06 12:26:35 +00:00
sendfile_windows.go net: fix inconsistent errors 2015-05-05 09:40:07 +00:00
server_test.go net: Make Listen(":port") use IPv6 when IPv4 is not supported. 2015-09-05 02:31:22 +00:00
sock_bsd.go
sock_cloexec.go net: fix inconsistent errors 2015-05-05 09:40:07 +00:00
sock_linux.go
sock_plan9.go
sock_posix.go net: add Dialer.Cancel to cancel pending dials 2015-12-15 21:15:15 +00:00
sock_stub.go
sock_windows.go net: fix inconsistent errors 2015-05-05 09:40:07 +00:00
sockopt_bsd.go net: adjust dual stack support on dragonfly 2015-05-23 05:22:57 +00:00
sockopt_linux.go
sockopt_plan9.go
sockopt_posix.go
sockopt_solaris.go
sockopt_stub.go
sockopt_windows.go
sockoptip_bsd.go
sockoptip_linux.go
sockoptip_posix.go
sockoptip_stub.go
sockoptip_windows.go
sys_cloexec.go net: fix inconsistent errors 2015-05-05 09:40:07 +00:00
tcp_test.go net: fix race in TestTCPStress 2015-12-22 03:39:39 +00:00
tcpsock_plan9.go net: add Dialer.Cancel to cancel pending dials 2015-12-15 21:15:15 +00:00
tcpsock_posix.go net: add Dialer.Cancel to cancel pending dials 2015-12-15 21:15:15 +00:00
tcpsock.go net: don't return non-nil interface values as Source, Addr in OpError 2015-06-13 23:39:03 +00:00
tcpsockopt_darwin.go
tcpsockopt_dragonfly.go
tcpsockopt_openbsd.go
tcpsockopt_plan9.go net: remove imports of strconv 2015-10-05 22:39:12 +00:00
tcpsockopt_posix.go
tcpsockopt_solaris.go net: try to fix setKeepAlivePeriod on Solaris 2015-05-06 12:03:20 +00:00
tcpsockopt_stub.go
tcpsockopt_unix.go net: try to fix setKeepAlivePeriod on Solaris 2015-05-06 12:03:20 +00:00
tcpsockopt_windows.go net: fix inconsistent errors 2015-05-05 09:40:07 +00:00
timeout_test.go net: fix timeout test bug 2016-01-06 17:59:46 +00:00
udp_test.go net: adjust dual stack support on dragonfly 2015-05-23 05:22:57 +00:00
udpsock_plan9.go net: don't return non-nil interface values as Source, Addr in OpError 2015-06-13 23:39:03 +00:00
udpsock_posix.go net: add Dialer.Cancel to cancel pending dials 2015-12-15 21:15:15 +00:00
udpsock.go net: don't return non-nil interface values as Source, Addr in OpError 2015-06-13 23:39:03 +00:00
unix_test.go net: add test for CL 17458 2015-12-14 20:37:42 +00:00
unixsock_plan9.go net: don't return non-nil interface values as Source, Addr in OpError 2015-06-13 23:39:03 +00:00
unixsock_posix.go net: add Dialer.Cancel to cancel pending dials 2015-12-15 21:15:15 +00:00
unixsock.go net: don't return non-nil interface values as Source, Addr in OpError 2015-06-13 23:39:03 +00:00