Skip to content
Snippets Groups Projects
  • Will McCutchen's avatar
    3761c4ae
    Add tests for correct handling of Expect: 100-continue (#138) · 3761c4ae
    Will McCutchen authored
    Issue #129 prompted me to look into how go-httpbin actually handles
    incoming requests that specify an `Expect: 100-continue` header. Here we
    add additional unit tests to explicitly codify the, uh, _expected_
    behavior for those requests.
    
    Note that the Go stdlib http client and server implementations have
    automagical `Expect: 100-continue` handling, which means
    these particular tests need to be written at a slightly lower level, by
    directly writing to and reading from the underlying TCP connection.
    
    Now, it may well be that the the moving parts (e.g. load balancers)
    between a client and the instances of go-httpbin deployed at
    https://httpbingo.org intervene and change this behavior, but these
    tests give me some confidence that, at least when such requests are made
    directly to go-httpbin itself, we are correctly handling them.
    Add tests for correct handling of Expect: 100-continue (#138)
    Will McCutchen authored
    Issue #129 prompted me to look into how go-httpbin actually handles
    incoming requests that specify an `Expect: 100-continue` header. Here we
    add additional unit tests to explicitly codify the, uh, _expected_
    behavior for those requests.
    
    Note that the Go stdlib http client and server implementations have
    automagical `Expect: 100-continue` handling, which means
    these particular tests need to be written at a slightly lower level, by
    directly writing to and reading from the underlying TCP connection.
    
    Now, it may well be that the the moving parts (e.g. load balancers)
    between a client and the instances of go-httpbin deployed at
    https://httpbingo.org intervene and change this behavior, but these
    tests give me some confidence that, at least when such requests are made
    directly to go-httpbin itself, we are correctly handling them.
handlers_test.go 84.88 KiB