• Posts
  • RSS
  • ◂◂RSS
  • Contact

  • See Raw Headers with Netcat

    October 5th, 2015
    tech  [html]
    Getting response headers is easy: run curl -D- -o/dev/null -sS [url] or load the site in a browser with the networking tab open. Getting request headers is harder, because webservers don't have a way to dump this exactly as they received it. Yes, you can set them to log specific headers, but logging all headers exactly as they came over the wire isn't something I see in nginx or apache. Netcat can help here. Start it up on some unused port:
        nc -lp 8070
    
    Now make the thing you're debugging visit yoursite:8070. Netcat will print out what headers you got:
        GET / HTTP/1.1
        Host: www.jefftk.com:8070
        Referer: http://www.jefftk.com/...
        Accept-Encoding: gzip,deflate
        Cache-Control: no-store, no-cache
        Accept-Language: en-US
        Connection: Keep-alive
        Accept: */*
        Accept-Encoding: gzip,deflate
        ...
    
    See the duplicate Accept-Encoding header? It turned out that A was adding an extra encoding header which then made B disable gzip. [1] Once I had the raw headers as sent it was pretty clear what the problem was.

    (Because the problem was a duplicated header I'm glad I didn't go with a higher level tool that might have masked that problem by storing headers in hashtable or something.)


    [1] Sniffing the traffic would have been ideal, but I wasn't in a position to get in between them.

    Comment via: google plus, facebook

    Recent posts on blogs I like:

    Who Should Bear the Risk in Infrastructure Projects?

    The answer to the question is the public sector, always. It’s okay to have private-sector involvement in construction, but the risk must be borne by the public sector, or else the private sector will just want more money to compensate for the extra risk. …

    via Pedestrian Observations November 30, 2020

    Fireside Friday, November 27, 2020

    Hey folks! Fireside this week. A bit of a change-up in terms of the coming attractions. I had planned to start “Textiles, How Did They Make It?” next, but I want to do a bit more reading on some of the initial stages of textile production (that is, the pr…

    via A Collection of Unmitigated Pedantry November 27, 2020

    Thoughts you mightn't have thunk about remote meetings

    Welcome to this week's edition of "building a startup in 2020," in which all your meetings are suddenly remote, and you probably weren't prepared for it. I know I wasn't. We started a "fully remote" company back in 2019, but …

    via apenwarr November 23, 2020

    more     (via openring)


  • Posts
  • RSS
  • ◂◂RSS
  • Contact