davecheney / httpstat

It's like curl -v, with colours.
MIT License
7.07k stars 385 forks source link

httptrace does not break out each leg of a 30x redirect chain. #83

Closed davecheney closed 8 years ago

davecheney commented 8 years ago

With #7 merged only the final leg of a 30x redirect chain is reported. This is a regression.

zapf(~/src/github.com/davecheney/httpstat) % httpstat -L https://google.com/

Connected to 216.58.199.78:443

Connected to 150.101.161.207:443

HTTP/1.1 200 OK
Server: gws
Alt-Svc: quic=":443"; ma=2592000; v="36,35,34,33,32"
Cache-Control: private, max-age=0
Content-Type: text/html; charset=ISO-8859-1
Date: Wed, 28 Sep 2016 01:59:28 GMT
Expires: -1
P3p: CP="This is not a P3P policy! See https://www.google.com/support/accounts/answer/151657?hl=en for more info."
Set-Cookie: NID=87=AW23QT-3Jr7sBhWZfUORexa_5nsDTXe9jp2iNKYKemqJlG7tM_LdEvqz1UZtUZ57QYm4PaoHrAlGpT_-S9KOC0Kg-xaozwQrdK3AoLwB7XWRQ6hrIrjndWgoQUiF695C; expires=Thu, 30-Mar-2017 01:59:28 GMT; path=/; domain=.google.com.au; HttpOnly
X-Frame-Options: SAMEORIGIN
X-Xss-Protection: 1; mode=block

Body discarded

  DNS Lookup   TCP Connection   TLS Handshake   Server Processing   Content Transfer
[     23ms  |          21ms  |         61ms  |            201ms  |             3ms  ]
            |                |               |                   |                  |
   namelookup:23ms           |               |                   |                  |
                       connect:44ms          |                   |                  |
                                   pretransfer:106ms             |                  |
                                                     starttransfer:307ms            |
                                                                                total:310ms    
davecheney commented 8 years ago

The expected output is

zapf(~/src/github.com/davecheney/httpstat) % ./httpstat-master -L https://google.com/

Connected to 216.58.199.78:443

HTTP/1.1 302 Found
Alt-Svc: quic=":443"; ma=2592000; v="36,35,34,33,32"
Cache-Control: private
Content-Length: 263
Content-Type: text/html; charset=UTF-8
Date: Wed, 28 Sep 2016 02:01:40 GMT
Location: https://www.google.com.au/?gfe_rd=cr&ei=hCTrV-2oDNDN8geqirfYDA

  DNS Lookup   TCP Connection   TLS Handshake   Server Processing   Content Transfer
[      1ms  |          21ms  |        112ms  |             19ms  |             0ms  ]
            |                |               |                   |                  |
   namelookup:1ms            |               |                   |                  |
                       connect:23ms          |                   |                  |
                                   pretransfer:135ms             |                  |
                                                     starttransfer:154ms            |
                                                                                total:154ms    

Connected to 150.101.161.207:443

HTTP/1.1 200 OK
Server: gws
Accept-Ranges: none
Alt-Svc: quic=":443"; ma=2592000; v="36,35,34,33,32"
Cache-Control: private, max-age=0
Content-Type: text/html; charset=ISO-8859-1
Date: Wed, 28 Sep 2016 02:01:40 GMT
Expires: -1
P3p: CP="This is not a P3P policy! See https://www.google.com/support/accounts/answer/151657?hl=en for more info."
Set-Cookie: NID=87=h_eeDm_Kt4hU5Uohls5TQFsyCLCTLyo1Yye7crXyaT-w16UeDn_6CpRpnc8GbH7LR49I5Qhuq5315-ujBk_GqdH4RX5c1IpCdArk7B3slMp_N4v4a5VqfWoWpdPAE09p; expires=Thu, 30-Mar-2017 02:01:40 GMT; path=/; domain=.google.com.au; HttpOnly
Vary: Accept-Encoding
X-Frame-Options: SAMEORIGIN
X-Xss-Protection: 1; mode=block

Body discarded

  DNS Lookup   TCP Connection   TLS Handshake   Server Processing   Content Transfer
[      2ms  |          22ms  |         71ms  |            194ms  |             6ms  ]
            |                |               |                   |                  |
   namelookup:2ms            |               |                   |                  |
                       connect:24ms          |                   |                  |
                                   pretransfer:96ms              |                  |
                                                     starttransfer:291ms            |
                                                                                total:298ms