I'm planning on using go-httpbin for integration tests of an HTTP intercepting proxy. Thanks for maintaining it!
I will come up with some more "exotic" feature requests and have to see how easy it is to add those myself.
I'd love to see support for chunked encoding with trailers.
https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Transfer-Encoding
https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Trailer
https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Server-Timing
Here's a rough idea:
/chunked/:n Generates a chunked response with n random chunks of variable size, a Transfer-Encoding: chunked header and an optional Server-Timing trailer
Parameters:
minsize=1: Min number of random bytes
maxsize=1024: Max number of random bytes
trailer=1: Include the Trailer: Server-Timing header and Server-Timing trailer
Does that sound like something you would accept? Do you see any problems? I don't really care about Server-Timing directly, but I need any trailer. Foo would do but I thought we might as well use something that's actually used IRL and has some browser support.
To support max-body-size we could just check the worst case maxsize * n before doing anything.
I'm planning on using go-httpbin for integration tests of an HTTP intercepting proxy. Thanks for maintaining it!
I will come up with some more "exotic" feature requests and have to see how easy it is to add those myself.
I'd love to see support for chunked encoding with trailers.
https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Transfer-Encoding
https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Trailer
https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Server-Timing
Here's a rough idea:
/chunked/:nGenerates a chunked response withnrandom chunks of variable size, aTransfer-Encoding: chunkedheader and an optionalServer-TimingtrailerParameters:
minsize=1: Min number of random bytesmaxsize=1024: Max number of random bytestrailer=1: Include theTrailer: Server-Timingheader andServer-TimingtrailerDoes that sound like something you would accept? Do you see any problems? I don't really care about
Server-Timingdirectly, but I need any trailer.Foowould do but I thought we might as well use something that's actually used IRL and has some browser support.To support
max-body-sizewe could just check the worst casemaxsize * nbefore doing anything.