davecheney / httpstat

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

HTTP output not replacing %s #73

Closed zquestz closed 7 years ago

zquestz commented 7 years ago

Notice this in my testing.

httpstat http://google.com
Connected to 172.217.3.206:80

HTTP/1.1 301 Moved Permanently
Server: gws
Cache-Control: public, max-age=2592000
Content-Length: 219
Content-Type: text/html; charset=UTF-8
Date: Mon, 26 Sep 2016 22:30:39 GMT
Expires: Wed, 26 Oct 2016 22:30:39 GMT
Location: http://www.google.com/
X-Frame-Options: SAMEORIGIN
X-Xss-Protection: 1; mode=block

   DNS Lookup   TCP Connection   Server Processing   Content Transfer
[ %s  |     %s  |        %s  |       %s  ]
             |                |                   |                  |
    namelookup:%s      |                   |                  |
                        connect:%s         |                  |
                                      starttransfer:%s        |
                                                                 total:%s
    110ms     23ms     34ms      0ms110ms    133ms    168ms    168ms    %  

If you query with https then the output looks right.

Connected to 172.217.3.206:443

HTTP/1.1 301 Moved Permanently
Server: gws
Alt-Svc: quic=":443"; ma=2592000; v="36,35,34,33,32"
Cache-Control: public, max-age=2592000
Content-Length: 220
Content-Type: text/html; charset=UTF-8
Date: Mon, 26 Sep 2016 22:31:06 GMT
Expires: Wed, 26 Oct 2016 22:31:06 GMT
Location: https://www.google.com/
X-Frame-Options: SAMEORIGIN
X-Xss-Protection: 1; mode=block

  DNS Lookup   TCP Connection   TLS Handshake   Server Processing   Content Transfer
[      0ms  |          23ms  |        137ms  |             36ms  |             0ms  ]
            |                |               |                   |                  |
   namelookup:0ms            |               |                   |                  |
                       connect:23ms          |                   |                  |
                                   pretransfer:161ms             |                  |
                                                     starttransfer:198ms            |
                                                                                total:198ms   
davecheney commented 7 years ago

Fixed, sorry about that.

zquestz commented 7 years ago

Thanks for the speedy fix. =)

moorereason commented 7 years ago

@davecheney, just out of curiosity, how did that compile? Where was print() defined??

davecheney commented 7 years ago

Not a worry, that was my mistake.

On Tue, 27 Sep 2016, 08:39 Josh Ellithorpe notifications@github.com wrote:

Thanks for the speedy fix. =)

— You are receiving this because you modified the open/close state.

Reply to this email directly, view it on GitHub https://github.com/davecheney/httpstat/issues/73#issuecomment-249718456, or mute the thread https://github.com/notifications/unsubscribe-auth/AAAcA0lVdHwVcymObMz3-SKelgBL1WY_ks5quEmegaJpZM4KHELS .

moorereason commented 7 years ago

facepalm

Nevermind. Forgot that print and println are part the Go core spec. I never use them when I probably should!

davecheney commented 7 years ago

print is a builtin

On Tue, 27 Sep 2016, 08:40 Cameron Moore notifications@github.com wrote:

@davecheney https://github.com/davecheney, just out of curiosity, how did that compile? Where was print() defined??

— You are receiving this because you were mentioned.

Reply to this email directly, view it on GitHub https://github.com/davecheney/httpstat/issues/73#issuecomment-249718643, or mute the thread https://github.com/notifications/unsubscribe-auth/AAAcA8bn4wPIdldBuO0TpORQt_21BZs9ks5quEnbgaJpZM4KHELS .